summaryrefslogtreecommitdiff
path: root/t/op.split
diff options
context:
space:
mode:
Diffstat (limited to 't/op.split')
-rw-r--r--t/op.split24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/op.split b/t/op.split
new file mode 100644
index 0000000000..988af49d3d
--- /dev/null
+++ b/t/op.split
@@ -0,0 +1,24 @@
+#!./perl
+
+# $Header: op.split,v 1.0 87/12/18 13:14:20 root Exp $
+
+print "1..4\n";
+
+$FS = ':';
+
+$_ = 'a:b:c';
+
+($a,$b,$c) = split($FS,$_);
+
+if (join(';',$a,$b,$c) eq 'a;b;c') {print "ok 1\n";} else {print "not ok 1\n";}
+
+@ary = split(/:b:/);
+if (join("$_",@ary) eq 'aa:b:cc') {print "ok 2\n";} else {print "not ok 2\n";}
+
+$_ = "abc\n";
+@ary = split(//);
+if (join(".",@ary) eq "a.b.c.\n") {print "ok 3\n";} else {print "not ok 3\n";}
+
+$_ = "a:b:c::::";
+@ary = split(/:/);
+if (join(".",@ary) eq "a.b.c") {print "ok 4\n";} else {print "not ok 4\n";}