source: trunk/essentials/dev-lang/perl/t/io/print.t

Last change on this file was 3181, checked in by bird, 18 years ago

perl 5.8.8

File size: 1.1 KB
Line 
1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6}
7
8use strict 'vars';
9eval 'use Errno';
10die $@ if $@ and !$ENV{PERL_CORE_MINITEST};
11
12print "1..21\n";
13
14my $foo = 'STDOUT';
15print $foo "ok 1\n";
16
17print "ok 2\n","ok 3\n","ok 4\n";
18print STDOUT "ok 5\n";
19
20open(foo,">-");
21print foo "ok 6\n";
22
23printf "ok %d\n",7;
24printf("ok %d\n",8);
25
26my @a = ("ok %d%c",9,ord("\n"));
27printf @a;
28
29$a[1] = 10;
30printf STDOUT @a;
31
32$, = ' ';
33$\ = "\n";
34
35print "ok","11";
36
37my @x = ("ok","12\nok","13\nok");
38my @y = ("15\nok","16");
39print @x,"14\nok",@y;
40{
41 local $\ = "ok 17\n# null =>[\000]\nok 18\n";
42 print "";
43}
44
45$\ = '';
46
47if (!exists &Errno::EBADF) {
48 print "ok 19 # skipped: no EBADF\n";
49} else {
50 $! = 0;
51 print NONEXISTENT "foo";
52 print "not " if ($! != &Errno::EBADF);
53 print "ok 19\n";
54}
55
56{
57 # Change 26009: pp_print didn't extend the stack
58 # before pushing its return value
59 # to make sure only that these obfuscated sentences will not crash.
60
61 map print(reverse), ('')x68;
62 print "ok 20\n";
63
64 map print(+()), ('')x68;
65 print "ok 21\n";
66}
Note: See TracBrowser for help on using the repository browser.