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
CommitLineData
48c4c863 1#!perl -w
06fdbb00
JK
2
3# This test file does not use test.pl because of the involved way in which it
4# generates its TAP output.
5
48c4c863
NC
6print "1..5\n";
7
2d90ac95 8my $file = "Run_switchF1.pl";
48c4c863
NC
9
10open F, ">$file" or die "Open $file: $!";
11
12my $prog = <<'EOT';
13#!./perl -anF[~#QQ\\xq']
14
15BEGIN {
16 *ARGV = *DATA;
17}
18print "@F";
19
20__DATA__
c3857f22
JK
21okx1x- use of alternate delimiter (lower case letter) in -F
22okq2q- use of alternate delimiter (lower case letter) in -F
23ok\3\- use of alternate delimiter (backslash) in -F
24ok'4'- use of alternate delimiter (apostrophe) in -F
48c4c863
NC
25EOT
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
30print F $prog;
31close F or die "Close $file: $!";
32
c3857f22
JK
33$count = 5;
34$result = "ok $count - complete test of alternate delimiters in -F\n";
35print system ($^X, $file) ? "not $result" : $result;
48c4c863
NC
36
37unlink $file or die "Unlink $file: $!";