Prv8 Shell
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4
System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64
User : jackjohn ( 502)
PHP Version : 5.3.17
Disable Function : NONE
Directory :  /installd/perl588installer/perl-5.8.8/t/comp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //installd/perl588installer/perl-5.8.8/t/comp/term.t
#!./perl

# tests that aren't important enough for base.term

print "1..23\n";

$x = "\\n";
print "#1\t:$x: eq " . ':\n:' . "\n";
if ($x eq '\n') {print "ok 1\n";} else {print "not ok 1\n";}

$x = "#2\t:$x: eq :\\n:\n";
print $x;
unless (index($x,'\\\\')>0) {print "ok 2\n";} else {print "not ok 2\n";}

if (length('\\\\') == 2) {print "ok 3\n";} else {print "not ok 3\n";}

$one = 'a';

if (length("\\n") == 2) {print "ok 4\n";} else {print "not ok 4\n";}
if (length("\\\n") == 2) {print "ok 5\n";} else {print "not ok 5\n";}
if (length("$one\\n") == 3) {print "ok 6\n";} else {print "not ok 6\n";}
if (length("$one\\\n") == 3) {print "ok 7\n";} else {print "not ok 7\n";}
if (length("\\n$one") == 3) {print "ok 8\n";} else {print "not ok 8\n";}
if (length("\\\n$one") == 3) {print "ok 9\n";} else {print "not ok 9\n";}
if (length("\\${one}") == 2) {print "ok 10\n";} else {print "not ok 10\n";}

if ("${one}b" eq "ab") { print "ok 11\n";} else {print "not ok 11\n";}

@foo = (1,2,3);
if ("$foo[1]b" eq "2b") { print "ok 12\n";} else {print "not ok 12\n";}
if ("@foo[0..1]b" eq "1 2b") { print "ok 13\n";} else {print "not ok 13\n";}
$" = '::';
if ("@foo[0..1]b" eq "1::2b") { print "ok 14\n";} else {print "not ok 14\n";}

# test if C<eval "{...}"> distinguishes between blocks and hashrefs

$a = "{ '\\'' , 'foo' }";
$a = eval $a;
if (ref($a) eq 'HASH') {print "ok 15\n";} else {print "not ok 15\n";}

$a = "{ '\\\\\\'abc' => 'foo' }";
$a = eval $a;
if (ref($a) eq 'HASH') {print "ok 16\n";} else {print "not ok 16\n";}

$a = "{'a\\\n\\'b','foo'}";
$a = eval $a;
if (ref($a) eq 'HASH') {print "ok 17\n";} else {print "not ok 17\n";}

$a = "{'\\\\\\'\\\\'=>'foo'}";
$a = eval $a;
if (ref($a) eq 'HASH') {print "ok 18\n";} else {print "not ok 18\n";}

$a = "{q,a'b,,'foo'}";
$a = eval $a;
if (ref($a) eq 'HASH') {print "ok 19\n";} else {print "not ok 19\n";}

$a = "{q[[']]=>'foo'}";
$a = eval $a;
if (ref($a) eq 'HASH') {print "ok 20\n";} else {print "not ok 20\n";}

# needs disambiguation if first term is a variable
$a = "+{ \$a , 'foo'}";
$a = eval $a;
if (ref($a) eq 'HASH') {print "ok 21\n";} else {print "not ok 21\n";}

$a = "+{ \$a=>'foo'}";
$a = eval $a;
if (ref($a) eq 'HASH') {print "ok 22\n";} else {print "not ok 22\n";}

$a = "{ 0x01 => 'foo'}->{0x01}";
$a = eval $a;
if ($a eq 'foo') {print "ok 23\n";} else {print "not ok 23\n";}

haha - 2025