This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
New tests: op/method.t and op/locale.t
[perl5.git] / t / lib / parsewords.t
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";