1#!perl -T 2# -*- mode: cperl ; compile-command: "cd .. ; ./Build ; prove -vb t/09-*.t" -*- 3 4BEGIN { $_ = defined && /(.*)/ && $1 for @ENV{qw/ TMPDIR TEMP TMP /} } # taint vs tempfile 5use Test::More tests => 6; 6use strict; 7use warnings; 8 9BEGIN { 10 use_ok( 'Test::Trap', 'trap', '$T' ); 11} 12 13my @r = trap { 10, 20, 30 }; 14is_deeply( $T->return, [10, 20, 30], 'Deeply' ); 15is_deeply( [ $T->return(0,2,1,1) ], [10, 30, 20, 20], 'Slice' ); 16is( $T->return(0), 10, 'Index 0' ); 17is( $T->return(1), 20, 'Index 1' ); 18is( $T->return(2), 30, 'Index 2' ); 19