From: Vincent Pit Date: Tue, 5 Aug 2008 12:38:17 +0000 (+0200) Subject: Add tests for end*() functions X-Git-Tag: v0.02~5 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=ed86f98b23ca99add0f670107a3bea7c62819803;p=perl%2Fmodules%2FSub-Nary.git Add tests for end*() functions --- diff --git a/t/24-ops.t b/t/24-ops.t index a74fa43..28e86e8 100644 --- a/t/24-ops.t +++ b/t/24-ops.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 26; +use Test::More tests => 32; use Sub::Nary; @@ -26,22 +26,34 @@ my @tests = ( [ sub { do { getpwnam 'root' } }, { 0 => 0.5, 10 => 0.5 } ], [ sub { 1; getpwuid '0' }, { 0 => 0.5, 10 => 0.5 } ], [ sub { eval { return getpwent } }, { 0 => 0.5, 10 => 0.5 } ], + [ sub { do { getgrnam 'root' } }, { 0 => 0.5, 4 => 0.5 } ], [ sub { 1; getgrgid '0' }, { 0 => 0.5, 4 => 0.5 } ], [ sub { eval { return getgrent } }, { 0 => 0.5, 4 => 0.5 } ], + [ sub { do { gethostbyname 'localhost' } }, 'list' ], [ sub { 1; gethostbyaddr '', '' }, 'list' ], [ sub { eval { return gethostent } }, 'list' ], + [ sub { do { getnetbyname '' } }, { 0 => 0.5, 4 => 0.5 } ], [ sub { 1; getnetbyaddr '', '' }, { 0 => 0.5, 4 => 0.5 } ], [ sub { eval { return getnetent } }, { 0 => 0.5, 4 => 0.5 } ], + [ sub { do { getprotobyname 'tcp' } }, { 0 => 0.5, 3 => 0.5 } ], [ sub { 1; getprotobynumber 6 }, { 0 => 0.5, 3 => 0.5 } ], [ sub { eval { return getprotoent } }, { 0 => 0.5, 3 => 0.5 } ], + [ sub { do { getservbyname 'ssh', 'tcp' } }, { 0 => 0.5, 4 => 0.5 } ], [ sub { 1; getservbyport 22, 'tcp' }, { 0 => 0.5, 4 => 0.5 } ], [ sub { eval { return getservent } }, { 0 => 0.5, 4 => 0.5 } ], + [ sub { endpwent }, 1 ], + [ sub { endgrent }, 1 ], + [ sub { endhostent }, 1 ], + [ sub { endnetent }, 1 ], + [ sub { endprotoent }, 1 ], + [ sub { endservent }, 1 ], + [ sub { <*.*> }, { list => 1 / 3, 1 => 2 / 3 } ], );