This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Further doc tweaks.
[perl5.git] / lib / English.t
CommitLineData
8990e307
LW
1#!./perl
2
60ed1d8c 3print "1..22\n";
8990e307 4
20822f61 5BEGIN { @INC = '../lib' }
60ed1d8c 6use English qw( -no_match_vars ) ;
f0f333f4 7use Config;
97404f98 8my $threads = $Config{'use5005threads'} || 0;
8990e307
LW
9
10print $PID == $$ ? "ok 1\n" : "not ok 1\n";
11
12$_ = 1;
54b9620d 13print $ARG == $_ || $threads ? "ok 2\n" : "not ok 2\n";
8990e307
LW
14
15sub foo {
f0f333f4 16 print $ARG[0] == $_[0] || $threads ? "ok 3\n" : "not ok 3\n";
8990e307
LW
17}
18&foo(1);
19
60ed1d8c
GS
20"abc" =~ /b/;
21
22print ! $PREMATCH ? "" : "not ", "ok 4\n" ;
23print ! $MATCH ? "" : "not ", "ok 5\n" ;
24print ! $POSTMATCH ? "" : "not ", "ok 6\n" ;
8990e307
LW
25
26$OFS = " ";
27$ORS = "\n";
28print 'ok',7;
29undef $OUTPUT_FIELD_SEPARATOR;
30
4a896658 31if ($threads) { $" = "\n" } else { $LIST_SEPARATOR = "\n" };
8990e307
LW
32@foo = ("ok 8", "ok 9");
33print "@foo";
34undef $OUTPUT_RECORD_SEPARATOR;
35
a0d0e21e 36eval 'NO SUCH FUNCTION';
4a896658 37print "ok 10\n" if $EVAL_ERROR =~ /method/ || $threads;
8990e307
LW
38
39print $UID == $< ? "ok 11\n" : "not ok 11\n";
40print $GID == $( ? "ok 12\n" : "not ok 12\n";
41print $EUID == $> ? "ok 13\n" : "not ok 13\n";
42print $EGID == $) ? "ok 14\n" : "not ok 14\n";
43
e3f58867 44print $PROGRAM_NAME eq $0 ? "ok 15\n" : "not ok 15\n";
8990e307 45print $BASETIME == $^T ? "ok 16\n" : "not ok 16\n";
60ed1d8c
GS
46
47package B ;
48
49use English ;
50
51"abc" =~ /b/;
52
53print $PREMATCH ? "" : "not ", "ok 17\n" ;
54print $MATCH ? "" : "not ", "ok 18\n" ;
55print $POSTMATCH ? "" : "not ", "ok 19\n" ;
56
57package C ;
58
59use English qw( -no_match_vars ) ;
60
61"abc" =~ /b/;
62
63print ! $PREMATCH ? "" : "not ", "ok 20\n" ;
64print ! $MATCH ? "" : "not ", "ok 21\n" ;
65print ! $POSTMATCH ? "" : "not ", "ok 22\n" ;