summaryrefslogtreecommitdiff
path: root/t/op
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-01-20 20:15:30 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-01-20 20:15:30 +0000
commit49cb94c67d828cadfe8cac24ae5955cf752eb2df (patch)
tree52cd7eb3150a55b88b170492879696fbbd72bda9 /t/op
parent3384d91b59037da95d8c4ea56131ee567d0c261c (diff)
downloadperl-49cb94c67d828cadfe8cac24ae5955cf752eb2df.tar.gz
Document and test the new qu operator.
p4raw-id: //depot/perl@8485
Diffstat (limited to 't/op')
-rw-r--r--t/op/qu.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/op/qu.t b/t/op/qu.t
new file mode 100644
index 0000000000..280020445c
--- /dev/null
+++ b/t/op/qu.t
@@ -0,0 +1,24 @@
+print "1..6\n";
+
+my $foo = "foo";
+
+print "not " unless qu(abc$foo) eq "abcfoo";
+print "ok 1\n";
+
+# qu is always Unicode, even in EBCDIC, so \x41 is 'A' and \x{61} is 'a'.
+
+print "not " unless qu(abc\x41) eq "abcA";
+print "ok 2\n";
+
+print "not " unless qu(abc\x{61}$foo) eq "abcafoo";
+print "ok 3\n";
+
+print "not " unless qu(\x{41}\x{100}\x61\x{200}) eq "A\x{100}a\x{200}";
+print "ok 4\n";
+
+print "not " unless join(" ", unpack("C*", qu(\x80))) eq "194 128";
+print "ok 5\n";
+
+print "not " unless join(" ", unpack("C*", qu(\x{100}))) eq "196 128";
+print "ok 6\n";
+