This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: implement flock() emulation
[perl5.git] / t / porting / ss_dup.t
CommitLineData
d8ca50cb
FC
1#!perl
2
a81bac00 3@TODO = qw [ SAVEt_SAVESWITCHSTACK ];
d8ca50cb
FC
4@TODO{@TODO} = ();
5
9224f6d1 6BEGIN { chdir 't'; @INC = "../lib"; require './test.pl' }
3a73a075
BF
7use Config;
8
9if ( $Config{usecrosscompile} ) {
10 skip_all( "Not all files are available during cross-compilation" );
11}
d8ca50cb
FC
12
13sub read_cases {
14 my ($file, $func) = @_;
15
16 open my $fh, $file or die "$0 cannot open $file: $!";
17
18 while (readline $fh) {
19 last if /^Perl_$func/;
20 }
21 my %found;
22 while (readline $fh) {
23 last if /^}/;
24 $found{$1}++ if /case (SAVEt_\w*):/;
25 }
26 close $fh or die "$0 cannot close $file: $!";
27 \%found;
28}
29
30my $leave_scope = read_cases "../scope.c", "leave_scope";
31my $ss_dup = read_cases "../sv.c", "ss_dup";
32
33ok scalar %$leave_scope, 'we got some';
34
35for (sort keys %$leave_scope) {
36 local $::TODO = ' ' if exists $TODO{$_};
37 ok exists $$ss_dup{$_}, "ss_dup handles $_";
38}
39
40done_testing;