| 1 | #!./perl |
| 2 | |
| 3 | BEGIN { |
| 4 | chdir 't' if -d 't'; |
| 5 | @INC = '../lib'; |
| 6 | } |
| 7 | |
| 8 | print "1..4\n"; |
| 9 | |
| 10 | use Text::ParseWords; |
| 11 | |
| 12 | @words = shellwords(qq(foo "bar quiz" zoo)); |
| 13 | #print join(";", @words), "\n"; |
| 14 | |
| 15 | print "not " if $words[0] ne 'foo'; |
| 16 | print "ok 1\n"; |
| 17 | |
| 18 | print "not " if $words[1] ne 'bar quiz'; |
| 19 | print "ok 2\n"; |
| 20 | |
| 21 | print "not " if $words[2] ne 'zoo'; |
| 22 | print "ok 3\n"; |
| 23 | |
| 24 | # Test quotewords() with other parameters |
| 25 | @words = quotewords(":+", 1, qq(foo:::"bar:foo":zoo zoo:)); |
| 26 | #print join(";", @words), "\n"; |
| 27 | print "not " unless join(";", @words) eq qq(foo;"bar:foo";zoo zoo); |
| 28 | print "ok 4\n"; |