File: test.pl

package info (click to toggle)
libuser-perl 1.9-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch, wheezy
  • size: 52 kB
  • ctags: 4
  • sloc: makefile: 37; perl: 26
file content (23 lines) | stat: -rw-r--r-- 550 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'

use strict;
use Test;
BEGIN { plan tests => 3 }

use User;

use Cwd qw( getcwd abs_path);

# Test 1: Check out Home using chdir()
my $oldpwd = getcwd;
$ENV{HOME} = $ENV{USERPROFILE} if ($^O eq 'MSWin32');
chdir();
ok( abs_path( User->Home ), getcwd );
chdir( $oldpwd );

# Test 2: Make sure Login returns something
ok( User->Login );

# Test 3: Make sure Login isn't unknown
ok( User->Login ne 'unknown' );