Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Perlito5 - more tests

  • Loading branch information...
commit 135fb4ccb331acbc0307e2cd1a9405927595b6ca 1 parent 7b23bb8
@fglock authored
Showing with 25 additions and 25 deletions.
  1. +25 −25 t5/base/lex.t
View
50 t5/base/lex.t
@@ -1,7 +1,7 @@
#!./perl
#print "1..57\n";
-print "1..29\n";
+print "1..37\n";
$x = 'x';
@@ -90,26 +90,26 @@ E2
]}
E1
-## $foo = FOO;
-## $bar = BAR;
-## $foo{$bar} = BAZ;
-## $ary[0] = ABC;
-##
-## print "$foo{$bar}" eq "BAZ" ? "ok 21\n" : "not ok 21\n";
-##
-## print "${foo}{$bar}" eq "FOO{BAR}" ? "ok 22\n" : "not ok 22\n";
-## print "${foo{$bar}}" eq "BAZ" ? "ok 23\n" : "not ok 23\n";
-##
-## print "FOO:" =~ /$foo[:]/ ? "ok 24\n" : "not ok 24\n";
-## print "ABC" =~ /^$ary[$A]$/ ? "ok 25\n" : "not ok 25\n";
-## print "FOOZ" =~ /^$foo[$A-Z]$/ ? "ok 26\n" : "not ok 26\n";
-##
-## # MJD 19980425
-## ($X, @X) = qw(a b c d);
-## print "d" =~ /^$X[-1]$/ ? "ok 27\n" : "not ok 27\n";
-## print "a1" !~ /^$X[-1]$/ ? "ok 28\n" : "not ok 28\n";
+$foo = FOO;
+$bar = BAR;
+$foo{$bar} = BAZ;
+$ary[0] = ABC;
+
+print "$foo{$bar}" eq "BAZ" ? "ok 21\n" : "not ok 21\n";
+
+print "${foo}{$bar}" eq "FOO{BAR}" ? "ok 22\n" : "not ok 22\n";
+print "${foo{$bar}}" eq "BAZ" ? "ok 23\n" : "not ok 23\n";
+
+print "FOO:" =~ /$foo[:]/ ? "ok 24\n" : "not ok 24\n";
+print "ABC" =~ /^$ary[$A]$/ ? "ok 25\n" : "not ok 25\n";
+print "FOOZ" =~ /^$foo[$A-Z]$/ ? "ok 26\n" : "not ok 26\n";
+
+# MJD 19980425
+($X, @X) = qw(a b c d);
+print "d" =~ /^$X[-1]$/ ? "ok 27\n" : "not ok 27\n";
+print "a1" !~ /^$X[-1]$/ ? "ok 28\n" : "not ok 28\n";
-print (((q{{\{\(}} . q{{\)\}}}) eq '{{\(}{\)}}') ? "ok 21\n" : "not ok 21\n");
+print (((q{{\{\(}} . q{{\)\}}}) eq '{{\(}{\)}}') ? "ok 29\n" : "not ok 29\n");
## $foo = "not ok 30\n";
@@ -174,11 +174,11 @@ print (((q{{\{\(}} . q{{\)\}}}) eq '{{\(}{\)}}') ? "ok 21\n" : "not ok 21\n");
$ {^M} = 'Someother 3';
package main;
print "not " unless $^Q eq 'Someother';
- print "ok 22\n";
+ print "ok 30\n";
print "not " unless $ {^Quixote} eq 'Someother 2';
- print "ok 23\n";
+ print "ok 31\n";
print "not " unless $ {^M} eq 'Someother 3';
- print "ok 24\n";
+ print "ok 32\n";
}
@@ -215,7 +215,7 @@ print (((q{{\{\(}} . q{{\)\}}}) eq '{{\(}{\)}}') ? "ok 21\n" : "not ok 21\n");
# arrays now *always* interpolate into "..." strings.
# 20000522 MJD (mjd@plover.com)
{
- my $test = 25;
+ my $test = 33;
eval(q(">@nosuch<" eq "><")) || print "# $@", "not ";
print "ok $test\n";
++$test;
@@ -274,4 +274,4 @@ print (((q{{\{\(}} . q{{\)\}}}) eq '{{\(}{\)}}') ? "ok 21\n" : "not ok 21\n");
# Is "[~" scanned correctly?
@a = (1,2,3);
print "not " unless($a[~~2] == 3);
-print "ok 29\n";
+print "ok 37\n";
Please sign in to comment.
Something went wrong with that request. Please try again.