This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add to known_pod_issues.dat following Test-Harness upgrade
[perl5.git] / t / porting / ss_dup.t
1 #!perl
2
3 @TODO = qw [ SAVEt_SAVESWITCHSTACK ];
4 @TODO{@TODO} = ();
5
6 BEGIN { chdir 't'; require './test.pl' }
7
8 sub 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
25 my $leave_scope = read_cases "../scope.c", "leave_scope";
26 my $ss_dup      = read_cases "../sv.c",    "ss_dup";
27
28 ok scalar %$leave_scope, 'we got some';
29
30 for (sort keys %$leave_scope) {
31   local $::TODO = ' ' if exists $TODO{$_};
32   ok exists $$ss_dup{$_}, "ss_dup handles $_";
33 }
34
35 done_testing;