require './test.pl';
}
-plan tests => 116;
+plan tests => 117;
my $Is_EBCDIC = (ord('i') == 0x89 & ord('J') == 0xd1);
like($@, qr/^Invalid range "m-d" in transliteration operator/,
'reversed range check');
-eval '$1 =~ tr/x/y/';
-like($@, qr/^Modification of a read-only value attempted/,
- 'cannot update read-only var');
-
'abcdef' =~ /(bcd)/;
is(eval '$1 =~ tr/abcd//', 3, 'explicit read-only count');
is($@, '', ' no error');
} # non-characters end
+{ # related to [perl #27940]
+ my $c;
+
+ ($c = "\x20\c@\x30\cA\x40\cZ\x50\c_\x60") =~ tr/\c@-\c_//d;
+ is($c, "\x20\x30\x40\x50\x60", "tr/\\c\@-\\c_//d");
+
+ ($c = "\x20\x00\x30\x01\x40\x1A\x50\x1F\x60") =~ tr/\x00-\x1f//d;
+ is($c, "\x20\x30\x40\x50\x60", "tr/\\x00-\\x1f//d");
+}
+