if (!squash)
o->op_private |= OPpTRANS_IDENTICAL;
}
+ else if (!squash && rlen == tlen && memEQ((char*)t, (char*)r, tlen)) {
+ o->op_private |= OPpTRANS_IDENTICAL;
+ }
for (i = 0; i < 256; i++)
tbl[i] = -1;
for (i = 0, j = 0; i < tlen; i++,j++) {
@INC = '../lib';
}
-print "1..71\n";
+print "1..72\n";
$_ = "abcdefghijklmnopqrstuvwxyz";
print ((eval '"123" =~ tr/12//' == 2) ? '' : 'not ', "ok 28\n");
# 29: test lhs bad if updating
-eval '"123" =~ tr/1/1/';
+eval '"123" =~ tr/1/2/';
print (($@ =~ m|^Can't modify constant item in transliteration \(tr///\)|)
? '' : 'not ', "ok 29\n");
tr/N/n/;
print +($_ eq 'n' ? '' : "not ") . "ok 71\n";
}
+
+# 72: counting on a constant
+$x = eval '"1213" =~ tr/1/1/';
+print $@ || $x != 2 ? "not ok 72\n" : "ok 72\n";