#!./perl
BEGIN {
chdir 't' if -d 't';
}
use warnings;
use Text::ParseWords;
print "1..18\n";
print "ok 1\n";
print "ok 2\n";
print "ok 3\n";
{
# Gonna get some undefined things back
# Test quotewords() with other parameters and null last field
print "ok 4\n";
}
# Test $keep eq 'delimiters' and last field zero
print "ok 5\n";
# Big ol' nasty test (thanks, Joerk!)
$string = 'aaaa"bbbbb" cc\\ cc \\\\\\"dddd" eee\\\\\\"ffff" "gg"';
# First with $keep == 1
print "ok 6\n";
# Now, $keep == 0
print "ok 7\n";
# Now test single quote behavior
$string = 'aaaa"bbbbb" cc\\ cc \\\\\\"dddd\' eee\\\\\\"ffff\' gg';
print "ok 8\n";
# Make sure @nested_quotewords does the right thing
print "ok 9\n";
# Now test error return
$string = 'foo bar baz"bach blech boop';
print "not " if (@words);
print "ok 10\n";
print "not " if (@words);
print "ok 11\n";
print "not " if (@words);
print "ok 12\n";
{
# Gonna get some more undefined things back
print "ok 13\n";
# Now test empty fields
print "ok 14\n";
# Test for 0 in quotes without $keep
print "ok 15\n";
# Test for \001 in quoted string
print "ok 16\n";
}
# Now test perlish single quote behavior
$string = 'aaaa"bbbbb" cc\ cc \\\\\"dddd\' eee\\\\\"\\\'ffff\' gg';
print "ok 17\n";
# test whitespace in the delimiters
print "ok 18\n";