diff options
Diffstat (limited to 'lib/B/Deparse-core.t')
-rw-r--r-- | lib/B/Deparse-core.t | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/lib/B/Deparse-core.t b/lib/B/Deparse-core.t index 981c74e673..b97cc71327 100644 --- a/lib/B/Deparse-core.t +++ b/lib/B/Deparse-core.t @@ -36,11 +36,10 @@ BEGIN { use strict; use Test::More; -plan tests => 4006; +plan tests => 3886; use feature (sprintf(":%vd", $^V)); # to avoid relying on the feature # logic to add CORE:: -no warnings 'experimental::autoderef'; use B::Deparse; my $deparse = new B::Deparse; @@ -103,7 +102,6 @@ sub testit { unless ($got_text =~ / package (?:lexsub)?test; - BEGIN \{\$\{\^WARNING_BITS} = "[^"]*"} use strict 'refs', 'subs'; use feature [^\n]+ \Q$vars\E\(\) = (.*) @@ -252,6 +250,7 @@ testit do => 'do { 1 };', "do {\n 1\n };"; testit each => 'CORE::each %bar;'; +testit each => 'CORE::each @foo;'; testit eof => 'CORE::eof();'; @@ -271,17 +270,32 @@ testit glob => 'CORE::glob $a;', 'CORE::glob($a);'; testit grep => 'CORE::grep { $a } $b, $c', 'grep({$a;} $b, $c);'; testit keys => 'CORE::keys %bar;'; +testit keys => 'CORE::keys @bar;'; testit map => 'CORE::map { $a } $b, $c', 'map({$a;} $b, $c);'; testit not => '3 unless CORE::not $a && $b;'; +testit pop => 'CORE::pop @foo;'; + +testit push => 'CORE::push @foo;', 'CORE::push(@foo);'; +testit push => 'CORE::push @foo, 1;', 'CORE::push(@foo, 1);'; +testit push => 'CORE::push @foo, 1, 2;', 'CORE::push(@foo, 1, 2);'; + testit readline => 'CORE::readline $a . $b;'; testit readpipe => 'CORE::readpipe $a + $b;'; testit reverse => 'CORE::reverse sort(@foo);'; +testit shift => 'CORE::shift @foo;'; + +testit splice => q{CORE::splice @foo;}, q{CORE::splice(@foo);}; +testit splice => q{CORE::splice @foo, 0;}, q{CORE::splice(@foo, 0);}; +testit splice => q{CORE::splice @foo, 0, 1;}, q{CORE::splice(@foo, 0, 1);}; +testit splice => q{CORE::splice @foo, 0, 1, 'a';}, q{CORE::splice(@foo, 0, 1, 'a');}; +testit splice => q{CORE::splice @foo, 0, 1, 'a', 'b';}, q{CORE::splice(@foo, 0, 1, 'a', 'b');}; + # note that the test does '() = split...' which is why the # limit is optimised to 1 testit split => 'split;', q{split(' ', $_, 1);}; @@ -298,7 +312,12 @@ testit sub => 'CORE::sub { $a, $b }', testit system => 'CORE::system($foo $bar);'; +testit unshift => 'CORE::unshift @foo;', 'CORE::unshift(@foo);'; +testit unshift => 'CORE::unshift @foo, 1;', 'CORE::unshift(@foo, 1);'; +testit unshift => 'CORE::unshift @foo, 1, 2;', 'CORE::unshift(@foo, 1, 2);'; + testit values => 'CORE::values %bar;'; +testit values => 'CORE::values @foo;'; # XXX These are deparsed wrapped in parens. @@ -463,7 +482,7 @@ defined 01 $+ die @ p1 # do handled specially # dump handled specially -each 1 - # also tested specially +# each handled specially endgrent 0 - endhostent 0 - endnetent 0 - @@ -522,7 +541,7 @@ index 23 p int 01 $ ioctl 3 p join 13 p -keys 1 - # also tested specially +# keys handled specially kill 123 p # last handled specially lc 01 $ @@ -555,12 +574,12 @@ ord 01 $ our 123 p+ # skip with 0 args, as our() => () pack 123 p pipe 2 p -pop 01 1 +pop 0 1 # also tested specially pos 01 $+ print @ p$+ printf @ p$+ prototype 1 + -push 123 p +# push handled specially quotemeta 01 $ rand 01 - read 34 p @@ -601,7 +620,7 @@ setprotoent 1 - setpwent 0 - setservent 1 - setsockopt 4 p -shift 01 1 +shift 0 1 # also tested specially shmctl 3 p shmget 3 p shmread 4 p @@ -613,7 +632,7 @@ socket 4 p socketpair 5 p sort @ p1+ # split handled specially -splice 12345 p +# splice handled specially sprintf 123 p sqrt 01 $ srand 01 - @@ -642,10 +661,10 @@ umask 01 - undef 01 + unlink @ p$ unpack 12 p$ -unshift 1 p +# unshift handled specially untie 1 - utime @ p1 -values 1 - # also tested specially +# values handled specially vec 3 p wait 0 - waitpid 2 p |