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