3 # $RCSfile: while.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:15 $
7 open (tmp,'>Cmd_while.tmp') || die "Can't create Cmd_while.tmp.";
17 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
21 if (!eof && /vt100/) {print "ok 1\n";} else {print "not ok 1 $_\n";}
26 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
31 if (!eof || /vt100/ || $bad) {print "not ok 2\n";} else {print "ok 2\n";}
36 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
38 if (s/vt100/VT100/g) {
45 if (!eof || $bad) {print "not ok 3\n";} else {print "ok 3\n";}
47 # now do the same with a label and a continue block
52 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
54 if (/vt100/) {last line;}
56 $badcont = 1 if /vt100/;
58 if (!eof && /vt100/) {print "ok 4\n";} else {print "not ok 4\n";}
59 if (!$badcont) {print "ok 5\n";} else {print "not ok 5\n";}
65 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
67 next entry if /vt100/;
70 $badcont = '' if /vt100/;
72 if (!eof || /vt100/ || $bad) {print "not ok 6\n";} else {print "ok 6\n";}
73 if (!$badcont) {print "ok 7\n";} else {print "not ok 7\n";}
79 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
81 if (s/vt100/VT100/g) {
88 $badcont = 1 if /vt100/;
90 if (!eof || $bad) {print "not ok 8\n";} else {print "ok 8\n";}
91 if (!$badcont) {print "ok 9\n";} else {print "not ok 9\n";}
93 close(fh) || die "Can't close Cmd_while.tmp.";
94 unlink 'Cmd_while.tmp' || `/bin/rm Cmd_While.tmp`;
101 # if ($x++ > 10) {last;}
105 #if ($x < 10) {print "ok 10\n";} else {print "not ok 10\n";}
113 # Check curpm is reset when jumping out of a scope
118 print "#$`,$&,$',\nnot " unless $` . $& . $' eq "abc";
120 { # Localize changes to $` and friends
122 redo WHILE if $i == 11;
123 next WHILE if $i == 12;
124 # 13 do a normal loop
125 last WHILE if $i == 14;
129 print "not " unless $` . $& . $' eq "abc";