From: Vincent Pit Date: Sun, 27 Feb 2011 20:52:16 +0000 (+0100) Subject: Test that imported XS calls are not deparsed X-Git-Tag: v0.05~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=1d2427fbf7b1ebd7c4e000f806265b61b3bda8ca;p=perl%2Fmodules%2FB-RecDeparse.git Test that imported XS calls are not deparsed --- diff --git a/t/17-calls.t b/t/17-calls.t index 99f5e4f..5d58d2a 100644 --- a/t/17-calls.t +++ b/t/17-calls.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 2 * 4 * 7; +use Test::More; use B::RecDeparse; @@ -20,10 +20,10 @@ my @tests = ( [ e3 => 'foo(@_)', '123' ], [ e4 => 'foo(shift)', '123' ], - [ x1 => 'bar()', 'bar' ], - [ x2 => 'bar(1)', 'bar' ], - [ x3 => 'bar(@_)', 'bar' ], - [ x4 => 'bar(shift)', 'bar' ], + [ n1 => 'bar()', 'bar' ], + [ n2 => 'bar(1)', 'bar' ], + [ n3 => 'bar(@_)', 'bar' ], + [ n4 => 'bar(shift)', 'bar' ], [ d1 => 'baz()', 'baz' ], [ d2 => 'baz(1)', 'baz' ], @@ -49,6 +49,17 @@ my @tests = ( [ m12 => 'shift->qux(shift)', 'qux' ], ); +if (eval 'use List::Util qw; 1') { + push @tests, ( + [ x1 => 'sum()', 'sum' ], + [ x2 => 'sum(1)', 'sum' ], + [ x3 => 'sum(@_)', 'sum' ], + [ x4 => 'sum(shift)', 'sum' ], + ); +} + +plan tests => 2 * @tests; + for my $test (@tests) { my ($name, $source, $match) = @$test;