]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - t/22-call.t
One more test to exaust for cases. Remove debugging cruft
[perl/modules/Sub-Nary.git] / t / 22-call.t
index f7bb741cf8027a5b18a2fcdda76e070d1e195e59..6aa786333a1bebd54980c6a27c63267796510e74 100644 (file)
@@ -3,12 +3,16 @@
 use strict;
 use warnings;
 
-use Test::More tests => 39;
+use Test::More tests => 42;
 
 use Sub::Nary;
 
 my $sn = Sub::Nary->new();
 
+sub CORE::GLOBAL::reset {
+ return 1, 2, 3
+}
+
 sub zero { }
 sub one  { 1 }
 sub two  { 1, 2 }
@@ -20,6 +24,8 @@ sub rec1 { rec2(); }
 sub rec2 { rec1(); }
 
 my @tests = (
+ [ sub { hlaghlaghlagh() }, 'list' ],
+
  [ sub { zero }, 0 ],
  [ sub { one  }, 1 ],
  [ sub { two  }, 2 ],
@@ -68,11 +74,15 @@ my @tests = (
  [ sub { \&zero },          1 ],
  [ sub { *zero },           1 ],
  [ sub { *zero{CODE}->() }, 'list' ],
+
+ [ sub { &CORE::GLOBAL::shift }, 'list' ],
+ [ sub { &CORE::GLOBAL::reset }, 3 ],
 );
 
 my $i = 1;
 for (@tests) {
  my $r = $sn->nary($_->[0]);
- is_deeply($r, { $_->[1] => 1 }, 'call test ' . $i);
+ my $exp = ref $_->[1] ? $_->[1] : { $_->[1] => 1 };
+ is_deeply($r, $exp, 'call test ' . $i);
  ++$i;
 }