| 1 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 1 | ▶ | use Test::More; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | use Chemistry::Mok; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | eval "use Chemistry::File::MDLMol"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | if ($@) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 8 | 0 | plan skip_all => "Chemistry::File::MDLMol is needed for testing"; | |||||||||
| 9 | } else { | ||||||||||
| 10 | 1 | my @fnames = glob('*.mok'); | |||||||||
| 11 | 1 | plan tests => @fnames * 2; | |||||||||
| 12 | |||||||||||
| 13 | 1 | for my $fname (@fnames) { | |||||||||
| 14 | 4 | $fname =~ s/\.mok$//; | |||||||||
| 15 | 4 | ▶ | open CODE, "<", "$fname.mok" or die "couldn't open $fname.mok: $!\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 4 | my $code = join "", <CODE>; | |||||||||
| 17 | |||||||||||
| 18 | 4 | ▶ | open EXPECTED, "<", "$fname.out" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | or die "couldn't open $fname.out: $!\n"; | ||||||||||
| 20 | 4 | my @expected = <EXPECTED>; | |||||||||
| 21 | |||||||||||
| 22 | 4 | ▶ | open GOT, '-|', "$^X -Mblib mok -f $fname.mok *.mol" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | or die "couln't open mok pipe: $!\n"; | ||||||||||
| 24 | 4 | my @got = <GOT>; | |||||||||
| 25 | 4 | is_deeply(\@got, \@expected, "mok -f $fname.mok *.mol"); | |||||||||
| 26 | |||||||||||
| 27 | SKIP: { | ||||||||||
| 28 | 4 | ▶ | if ($^O eq 'MSWin32') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | $code =~ s/\n//g; | |||||||||
| 30 | 0 | ▶ | skip "MSWin32", 1 if $code =~ /#/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | ▶ | open GOT, '-|', "$^X -Mblib mok \"$code\" *.mol" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | or die "couln't open mok pipe: $!\n"; | ||||||||||
| 33 | } else { | ||||||||||
| 34 | 4 | ▶ | open GOT, '-|', "$^X -Mblib mok '$code' *.mol" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | or die "couln't open mok pipe: $!\n"; | ||||||||||
| 36 | } | ||||||||||
| 37 | 4 | @got = <GOT>; | |||||||||
| 38 | 4 | is_deeply(\@got, \@expected, "mok '<$fname.mok>' *.mol"); | |||||||||
| 39 | } | ||||||||||
| 40 | } | ||||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||