summaryrefslogtreecommitdiff
path: root/t/lib/parsewords.t
diff options
context:
space:
mode:
authorGisle Aas <aas@aas.no>1996-09-22 00:59:56 +0200
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-09-22 00:59:56 +0200
commit1a3850a59b9c97ab76cb84b312a9b18e9a2cb3d6 (patch)
tree3da90e5219cc38029477ff010a08c6dc5add516f /t/lib/parsewords.t
parent782014036373aee8ffee0c1b2c77f3a283d90dc7 (diff)
downloadperl-1a3850a59b9c97ab76cb84b312a9b18e9a2cb3d6.tar.gz
More standard library test scripts
This is a collection of test scripts for the standard library modules. Some of the tests does not pass unless some of the patches I have sent out are applied.
Diffstat (limited to 't/lib/parsewords.t')
-rw-r--r--t/lib/parsewords.t28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/lib/parsewords.t b/t/lib/parsewords.t
new file mode 100644
index 0000000000..47a75881dc
--- /dev/null
+++ b/t/lib/parsewords.t
@@ -0,0 +1,28 @@
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+print "1..4\n";
+
+use Text::ParseWords;
+
+@words = shellwords(qq(foo "bar quiz" zoo));
+#print join(";", @words), "\n";
+
+print "not " if $words[0] ne 'foo';
+print "ok 1\n";
+
+print "not " if $words[1] ne 'bar quiz';
+print "ok 2\n";
+
+print "not " if $words[2] ne 'zoo';
+print "ok 3\n";
+
+# Test quotewords() with other parameters
+@words = quotewords(":+", 1, qq(foo:::"bar:foo":zoo zoo:));
+#print join(";", @words), "\n";
+print "not " unless join(";", @words) eq qq(foo;"bar:foo";zoo zoo);
+print "ok 4\n";