This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/loc_tools.pl: Consider thread 0 always locale-safe
[perl5.git] / t / run / switchF1.t
1 #!perl -w
2
3 # This test file does not use test.pl because of the involved way in which it
4 # generates its TAP output.
5
6 print "1..5\n";
7
8 my $file = "Run_switchF1.pl";
9
10 open F, ">$file" or die "Open $file: $!";
11
12 my $prog = <<'EOT';
13 #!./perl -anF[~#QQ\\xq']
14
15 BEGIN {
16     *ARGV = *DATA;
17 }
18 print "@F";
19
20 __DATA__
21 okx1x- use of alternate delimiter (lower case letter) in -F
22 okq2q- use of alternate delimiter (lower case letter) in -F
23 ok\3\- use of alternate delimiter (backslash) in -F
24 ok'4'- use of alternate delimiter (apostrophe) in -F
25 EOT
26
27 # 2 of the characters toke.c used to use to quote the split parameter:
28 $prog =~ s/QQ/\x01\x80/;
29 # These 2 plus ~ # and ' were enough to make perl choke
30 print F $prog;
31 close F or die "Close $file: $!";
32
33 $count = 5;
34 $result = "ok $count - complete test of alternate delimiters in -F\n";
35 print system ($^X, $file) ? "not $result" : $result;
36
37 unlink $file or die "Unlink $file: $!";