diff options
Diffstat (limited to 'ext/XS-APItest/t/multicall.t')
-rw-r--r-- | ext/XS-APItest/t/multicall.t | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/XS-APItest/t/multicall.t b/ext/XS-APItest/t/multicall.t new file mode 100644 index 0000000000..4a860477d1 --- /dev/null +++ b/ext/XS-APItest/t/multicall.t @@ -0,0 +1,24 @@ +#!perl -w + +# test the MULTICALL macros +# Note: as of Oct 2010, there are not yet comprehensive tests +# for these macros. + +use warnings; +use strict; + +use Test::More tests => 4; +use XS::APItest; + + +{ + my $sum = 0; + sub add { $sum += $_++ } + + my @a = (1..3); + XS::APItest::multicall_each \&add, @a; + is($sum, 6, "sum okay"); + is($a[0], 2, "a[0] okay"); + is($a[1], 3, "a[1] okay"); + is($a[2], 4, "a[2] okay"); +} |