| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | use warningsscip-perl cpan Test-Inter 1.13 warnings/ 'all'; |
| 4 | use strictscip-perl cpan Test-Inter 1.13 strict/; |
| 5 | BEGIN { |
| 6 | if (-d "lib") { |
| 7 | use libscip-perl cpan Test-Inter 1.13 lib/ "./lib"; |
| 8 | } elsif (-d "../lib") { |
| 9 | use libscip-perl cpan Test-Inter 1.13 lib/ "../lib"; |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | use Test::Interscip-perl cpan Test-Inter 1.13 Test/Inter/; |
| 14 | my $ti = new Test::Inter $0scip-perl cpan Test-Inter 1.13 main/$0.; |
| 15 | |
| 16 | sub funcscip-perl cpan Test-Inter 1.13 main/func(). { |
| 17 | my(@args) = @_scip-perl cpan Test-Inter 1.13 main/`@_`.; |
| 18 | my @ret; |
| 19 | foreach my $arg (@args) { |
| 20 | pushscip-perl cpan Test-Inter 1.13 main/push().(@ret,lengthscip-perl cpan Test-Inter 1.13 main/length().($arg)); |
| 21 | } |
| 22 | return @ret; |
| 23 | } |
| 24 | |
| 25 | $ti->testsscip-perl cpan Test-Inter 1.13 main/tests().(func => \&funcscip-perl cpan Test-Inter 1.13 main/func()., |
| 26 | tests => "foo => 3 |
| 27 | |
| 28 | a ab => 1 2 |
| 29 | |
| 30 | (x xy xyz) => 1 2 3 |
| 31 | |
| 32 | (a) (bc) => 1 2 |
| 33 | |
| 34 | (a (b cd)) => 1 1 2 |
| 35 | |
| 36 | (,a,bc) => 1 2 |
| 37 | |
| 38 | (,a,b c) => 1 3 |
| 39 | "); |
| 40 | |
| 41 | $ti->testsscip-perl cpan Test-Inter 1.13 main/tests().(func => \&funcscip-perl cpan Test-Inter 1.13 main/func()., |
| 42 | expected => [ [1,2] ], |
| 43 | tests => "a ab |
| 44 | |
| 45 | c cd |
| 46 | |
| 47 | e ef |
| 48 | "); |
| 49 | |
| 50 | $ti->testsscip-perl cpan Test-Inter 1.13 main/tests().(func => \&funcscip-perl cpan Test-Inter 1.13 main/func()., |
| 51 | expected => "1 2", |
| 52 | tests => "a ab |
| 53 | |
| 54 | c cd |
| 55 | |
| 56 | e ef |
| 57 | "); |
| 58 | |
| 59 | $ti->testsscip-perl cpan Test-Inter 1.13 main/tests().(tests => " '' '' |
| 60 | |
| 61 | [] [] |
| 62 | |
| 63 | {} {} |
| 64 | "); |
| 65 | |
| 66 | $ti->done_testingscip-perl cpan Test-Inter 1.13 main/done_testing().(); |