summaryrefslogtreecommitdiff
path: root/t/op.pack
diff options
context:
space:
mode:
Diffstat (limited to 't/op.pack')
-rw-r--r--t/op.pack18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/op.pack b/t/op.pack
new file mode 100644
index 0000000000..9806261836
--- /dev/null
+++ b/t/op.pack
@@ -0,0 +1,18 @@
+#!./perl
+
+# $Header: op.pack,v 3.0 89/10/18 15:30:39 lwall Locked $
+
+print "1..3\n";
+
+$format = "c2x5CCxsila6";
+@ary = (1,-100,127,128,32767,12345,123456,"abcdef");
+$foo = pack($format,@ary);
+@ary2 = unpack($format,$foo);
+
+print ($#ary == $#ary2 ? "ok 1\n" : "not ok 1\n");
+
+$out1=join(':',@ary);
+$out2=join(':',@ary2);
+print ($out1 eq $out2 ? "ok 2\n" : "not ok 2\n");
+
+print ($foo =~ /def/ ? "ok 3\n" : "not ok 3\n");