8 # This ok() function is specially written to avoid any concatenation.
13 printf "%sok %d - %s\n", ($ok ? "" : "not "), $test, $name;
15 printf "# Failed test at line %d\n", (caller)[2] unless $ok;
23 ($a, $b, $c) = qw(foo bar);
25 ok("$a" eq "foo", "verifying assign");
26 ok("$a$b" eq "foobar", "basic concatenation");
27 ok("$c$a$c" eq "foo", "concatenate undef, fore and aft");
29 # Okay, so that wasn't very challenging. Let's go Unicode.
34 $_ = $dx = "\x{10f2}";
37 ok($_ eq "$dx$dx","bug id 20000819.004, back");
40 $_ = $dx = "\x{10f2}";
43 ok($_ eq "$dx$dx","bug id 20000819.004, front");
47 $_ = "\x{10f2}\x{10f2}";
50 ok($_ eq "$dx$dx","bug id 20000819.004, front and back");
56 # test that undef left and right of utf8 results in a valid string
60 ok($a eq "\x{1ff}", "bug id 20000901.092, undef left");
62 ok($a eq "\x{1ff}", "bug id 20000901.092, undef right");
68 "x" =~ /(.)/; # unset $2
70 # Without the fix this 5.7.0 would croak:
71 # Modification of a read-only value attempted at ...
73 ok(!$@, "bug id 20001020.006, left");
75 # For symmetry with the above.
77 ok(!$@, "bug id 20001020.006, right");
80 # This bug existed earlier than the $2 bug, but is fixed with the same
81 # patch. Without the fix this 5.7.0 would also croak:
82 # Modification of a read-only value attempted at ...
84 ok(!$@, "bug id 20001020.006, constant left");
86 # For symmetry with the above.
88 ok(!$@, "bug id 20001020.006, constant right");