This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix O_CREAT without O_TRUNC in cpan/autodie/t/utf8_open.t
[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
6BEGIN { chdir 't'; require './test.pl' }
7
8sub read_cases {
9 my ($file, $func) = @_;
10
11 open my $fh, $file or die "$0 cannot open $file: $!";
12
13 while (readline $fh) {
14 last if /^Perl_$func/;
15 }
16 my %found;
17 while (readline $fh) {
18 last if /^}/;
19 $found{$1}++ if /case (SAVEt_\w*):/;
20 }
21 close $fh or die "$0 cannot close $file: $!";
22 \%found;
23}
24
25my $leave_scope = read_cases "../scope.c", "leave_scope";
26my $ss_dup = read_cases "../sv.c", "ss_dup";
27
28ok scalar %$leave_scope, 'we got some';
29
30for (sort keys %$leave_scope) {
31 local $::TODO = ' ' if exists $TODO{$_};
32 ok exists $$ss_dup{$_}, "ss_dup handles $_";
33}
34
35done_testing;