| 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 func1scip-perl cpan Test-Inter 1.13 main/func1(). { |
| 17 | my($tiutput) = @_scip-perl cpan Test-Inter 1.13 main/`@_`.; |
| 18 | |
| 19 | my @lines = ("First line", |
| 20 | "Second line", |
| 21 | "Third line"); |
| 22 | openscip-perl cpan Test-Inter 1.13 main/open().(OUT,">$tiutput"); |
| 23 | foreach my $line (@lines) { |
| 24 | print OUT "$line\n"; |
| 25 | } |
| 26 | closescip-perl cpan Test-Inter 1.13 main/close().(OUT); |
| 27 | } |
| 28 | |
| 29 | sub func2scip-perl cpan Test-Inter 1.13 main/func2(). { |
| 30 | my($input,$tiutput) = @_scip-perl cpan Test-Inter 1.13 main/`@_`.; |
| 31 | openscip-perl cpan Test-Inter 1.13 main/open().(IN,$input); |
| 32 | openscip-perl cpan Test-Inter 1.13 main/open().(OUT,">$tiutput"); |
| 33 | my @lines = <IN>; |
| 34 | print OUT @lines; |
| 35 | closescip-perl cpan Test-Inter 1.13 main/close().(IN); |
| 36 | closescip-perl cpan Test-Inter 1.13 main/close().(OUT); |
| 37 | } |
| 38 | |
| 39 | $ti->filescip-perl cpan Test-Inter 1.13 main/file().(\&func1scip-perl cpan Test-Inter 1.13 main/func1().,'', '','file.1.exp','No input'); |
| 40 | |
| 41 | $ti->filescip-perl cpan Test-Inter 1.13 main/file().(\&func2scip-perl cpan Test-Inter 1.13 main/func2().,'file.2.in','','file.2.exp','File copy'); |
| 42 | |
| 43 | $ti->done_testingscip-perl cpan Test-Inter 1.13 main/done_testing().(); |
| 44 |