X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fsubstr.t;h=85574d56ec9f4942f4a7faab50f305d184fb12de;hb=a4c04bdcc508b6a45f83e703d0f82401445aa55b;hp=12bcd00b33963cdeb3e85643cf512c65feeed632;hpb=847a5fae45dac396d0f9e1bb61d5b4ff9d94cdcd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/substr.t b/t/op/substr.t index 12bcd00..85574d5 100755 --- a/t/op/substr.t +++ b/t/op/substr.t @@ -1,6 +1,6 @@ #!./perl -print "1..162\n"; +print "1..174\n"; #P = start of string Q = start of substr R = end of substr S = end of string @@ -548,3 +548,40 @@ ok 162, length($x) == 5 && substr($x, 2, 1) eq "\x{100}" && substr($x, 3, 1) eq "\x{FF}" && substr($x, 4, 1) eq "\x{F3}"; + +substr($x = "ab", 0, 0, "\x{100}\x{200}"); +ok 163, $x eq "\x{100}\x{200}ab"; + +substr($x = "\x{100}\x{200}", 0, 0, "ab"); +ok 164, $x eq "ab\x{100}\x{200}"; + +substr($x = "ab", 1, 0, "\x{100}\x{200}"); +ok 165, $x eq "a\x{100}\x{200}b"; + +substr($x = "\x{100}\x{200}", 1, 0, "ab"); +ok 166, $x eq "\x{100}ab\x{200}"; + +substr($x = "ab", 2, 0, "\x{100}\x{200}"); +ok 167, $x eq "ab\x{100}\x{200}"; + +substr($x = "\x{100}\x{200}", 2, 0, "ab"); +ok 168, $x eq "\x{100}\x{200}ab"; + +substr($x = "\xFFb", 0, 0, "\x{100}\x{200}"); +ok 169, $x eq "\x{100}\x{200}\xFFb"; + +substr($x = "\x{100}\x{200}", 0, 0, "\xFFb"); +ok 170, $x eq "\xFFb\x{100}\x{200}"; + +substr($x = "\xFFb", 1, 0, "\x{100}\x{200}"); +ok 171, $x eq "\xFF\x{100}\x{200}b"; + +substr($x = "\x{100}\x{200}", 1, 0, "\xFFb"); +ok 172, $x eq "\x{100}\xFFb\x{200}"; + +substr($x = "\xFFb", 2, 0, "\x{100}\x{200}"); +ok 173, $x eq "\xFFb\x{100}\x{200}"; + +substr($x = "\x{100}\x{200}", 2, 0, "\xFFb"); +ok 174, $x eq "\x{100}\x{200}\xFFb"; +