diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-09 16:25:52 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-09 16:25:52 +0000 |
commit | 7b717bbdd56660beb2b3a65dc8b0144ca50b89e0 (patch) | |
tree | 00cccc78c790564430df946c6ca98aea500f6425 /lib | |
parent | 00f4e5f0f8f9ab7a3ccc1dd6729033740c59fc4f (diff) | |
download | perl-7b717bbdd56660beb2b3a65dc8b0144ca50b89e0.tar.gz |
Forgotten checkin.
p4raw-id: //depot/perl@13553
Diffstat (limited to 'lib')
-rw-r--r-- | lib/User/grent.t | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/User/grent.t b/lib/User/grent.t index 760b814d54..6d36dd16c2 100644 --- a/lib/User/grent.t +++ b/lib/User/grent.t @@ -5,40 +5,35 @@ BEGIN { @INC = '../lib'; } +use Test::More tests => 5; + BEGIN { our $hasgr; eval { my @n = getgrgid 0 }; $hasgr = 1 unless $@ && $@ =~ /unimplemented/; - unless ($hasgr) { print "1..0 # Skip: no getgrgid\n"; exit 0 } + unless ($hasgr) { plan skip_all => "no getgrgid"; } use Config; $hasgr = 0 unless $Config{'i_grp'} eq 'define'; - unless ($hasgr) { print "1..0 # Skip: no grp.h\n"; exit 0 } + unless ($hasgr) { plan skip_all => "no grp.h"; } } BEGIN { our @grent = getgrgid 0; # This is the function getgrgid. - unless (@grent) { print "1..0 # Skip: no gid 0\n"; exit 0 } + unless (@grent) { plan skip_all => "no gid 0"; } } -print "1..5\n"; - -use User::grent; -print "ok 1\n"; +BEGIN { use_ok('User::grent'); } +can_ok(__PACKAGE__, 'getgrgid'); -my $grent = getgrgid 0; # This is the OO getgrgid. +my $grent = getgrgid 0; -print "not " unless $grent->gid == 0; -print "ok 2\n"; +is( $grent->name, $grent[0], 'name matches core getgrgid' ); -print "not " unless $grent->name == $grent[0]; -print "ok 3\n"; +is( $grent->passwd, $grent[1], ' passwd' ); -print "not " unless $grent->passwd eq $grent[1]; -print "ok 4\n"; +is( $grent->gid, $grent[2], ' gid' ); -print "not " unless $grent->gid == $grent[2]; -print "ok 5\n"; # Testing pretty much anything else is unportable. |