]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - t/20-return.t
Add support and tests for the get{pw,gr,host,net,proto,serv}* functions. Move ops...
[perl/modules/Sub-Nary.git] / t / 20-return.t
index 98fecc9b68185d74afdb9eeadf9a1110c31c6463..e7e852d0c8e84582933beae4bc81c527c5018792 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 55;
+use Test::More tests => 50;
 
 use Sub::Nary;
 
@@ -72,19 +72,12 @@ my @tests = (
  [ sub { return eval { do { eval { @a } } } },      'list' ],
 
  [ sub { eval 'return 1, 2' }, 'list' ],
-
- [ sub { return <$x> }, 'list' ],
-
- [ sub { return -f $0, -r $0 }, 2 ],
-
- [ sub { return caller 0 },  sub { my @a = caller 0; scalar @a }->() ],
- [ sub { return localtime }, do { my @a = localtime; scalar @a } ],
- [ sub { return gmtime },    do { my @a = gmtime; scalar @a } ],
 );
 
 my $i = 1;
 for (@tests) {
  my $r = $sn->nary($_->[0]);
- is_deeply($r, { $_->[1] => 1 }, 'return test ' . $i);
+ my $exp = ref $_->[1] ? $_->[1] : { $_->[1] => 1 };
+ is_deeply($r, $exp, 'return test ' . $i);
  ++$i;
 }