summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2015-12-03 14:00:55 +0000
committerSteve Hay <steve.m.hay@googlemail.com>2015-12-03 14:05:50 +0000
commita28f0da7f5d8baefef1f3868d270369755117804 (patch)
tree61a3aab2265371c4b93cb9181f5203defc146762
parent2eb17d1d8a93746b71831fb53576551007aafc64 (diff)
downloadperl-a28f0da7f5d8baefef1f3868d270369755117804.tar.gz
Undo blead customization of Text-ParseWords test script
The customization simply changed DOS EOLs to UNIX EOLs, dating from a time when the intention was to get all files in blead into UNIX EOL format. However, since then many more files have crept in with DOS EOLs (for example, many files under cpan/Pod-Checker, cpan/Pod-Parser and cpan/Pod-Usage have DOS EOLs in my Git workspace (on Windows) and in the most recent perl release tarballs (5.22.1-RC3 (made from Windows) and 5.23.5 (not made from Windows AFAIK))) and they clearly do no harm, so there is no point in trying to make all files have UNIX EOLs and keep them that way, and therefore no point in this customization. The GitHub PR that was referenced in Porting/Maintainers.pl has already been closed (not merged). There are no changes to ParseWords.t here other than the EOLs.
-rwxr-xr-xPorting/Maintainers.pl7
-rw-r--r--cpan/Text-ParseWords/t/ParseWords.t244
-rw-r--r--t/porting/customized.dat1
3 files changed, 122 insertions, 130 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index daeb0c0bcc..c3bd64035b 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -1108,13 +1108,6 @@ use File::Glob qw(:case);
'Text::ParseWords' => {
'DISTRIBUTION' => 'CHORNY/Text-ParseWords-3.30.tar.gz',
'FILES' => q[cpan/Text-ParseWords],
-
- # Waiting to be merged upstream:
- # see https://github.com/chorny/Text-ParseWords/pull/6
- 'CUSTOMIZED' => [
- qw( t/ParseWords.t
- ),
- ],
},
'Text-Tabs+Wrap' => {
diff --git a/cpan/Text-ParseWords/t/ParseWords.t b/cpan/Text-ParseWords/t/ParseWords.t
index 3fb7ac67b2..905ea00864 100644
--- a/cpan/Text-ParseWords/t/ParseWords.t
+++ b/cpan/Text-ParseWords/t/ParseWords.t
@@ -1,122 +1,122 @@
-#!./perl
-
-use warnings;
-use Text::ParseWords;
-use Test::More tests => 27;
-
-@words = shellwords(qq(foo "bar quiz" zoo));
-is($words[0], 'foo');
-is($words[1], 'bar quiz');
-is($words[2], 'zoo');
-
-{
- # Gonna get some undefined things back
- no warnings 'uninitialized' ;
-
- # Test quotewords() with other parameters and null last field
- @words = quotewords(':+', 1, 'foo:::"bar:foo":zoo zoo:');
- is(join(";", @words), qq(foo;"bar:foo";zoo zoo;));
-}
-
-# Test $keep eq 'delimiters' and last field zero
-@words = quotewords('\s+', 'delimiters', '4 3 2 1 0');
-is(join(";", @words), qq(4; ;3; ;2; ;1; ;0));
-
-# Big ol' nasty test (thanks, Joerk!)
-$string = 'aaaa"bbbbb" cc\\ cc \\\\\\"dddd" eee\\\\\\"ffff" "gg"';
-
-# First with $keep == 1
-$result = join('|', parse_line('\s+', 1, $string));
-is($result, 'aaaa"bbbbb"|cc\\ cc|\\\\\\"dddd" eee\\\\\\"ffff"|"gg"');
-
-# Now, $keep == 0
-$result = join('|', parse_line('\s+', 0, $string));
-is($result, 'aaaabbbbb|cc cc|\\"dddd eee\\"ffff|gg');
-
-# Now test single quote behavior
-$string = 'aaaa"bbbbb" cc\\ cc \\\\\\"dddd\' eee\\\\\\"ffff\' gg';
-$result = join('|', parse_line('\s+', 0, $string));
-is($result, 'aaaabbbbb|cc cc|\\"dddd eee\\\\\\"ffff|gg');
-
-# Make sure @nested_quotewords does the right thing
-@lists = nested_quotewords('\s+', 0, 'a b c', '1 2 3', 'x y z');
-is (@lists, 3);
-is (@{$lists[0]}, 3);
-is (@{$lists[1]}, 3);
-is (@{$lists[2]}, 3);
-
-# Now test error return
-$string = 'foo bar baz"bach blech boop';
-
-@words = shellwords($string);
-is(@words, 0);
-
-@words = parse_line('s+', 0, $string);
-is(@words, 0);
-
-@words = quotewords('s+', 0, $string);
-is(@words, 0);
-
-{
- # Gonna get some more undefined things back
- no warnings 'uninitialized' ;
-
- @words = nested_quotewords('s+', 0, $string);
- is(@words, 0);
-
- # Now test empty fields
- $result = join('|', parse_line(':', 0, 'foo::0:"":::'));
- is($result, 'foo||0||||');
-
- # Test for 0 in quotes without $keep
- $result = join('|', parse_line(':', 0, ':"0":'));
- is($result, '|0|');
-
- # Test for \001 in quoted string
- $result = join('|', parse_line(':', 0, ':"' . "\001" . '":'));
- is($result, "|\1|");
-
-}
-
-# Now test perlish single quote behavior
-$Text::ParseWords::PERL_SINGLE_QUOTE = 1;
-$string = 'aaaa"bbbbb" cc\ cc \\\\\"dddd\' eee\\\\\"\\\'ffff\' gg';
-$result = join('|', parse_line('\s+', 0, $string));
-is($result, 'aaaabbbbb|cc cc|\"dddd eee\\\\"\'ffff|gg');
-
-# test whitespace in the delimiters
-@words = quotewords(' ', 1, '4 3 2 1 0');
-is(join(";", @words), qq(4;3;2;1;0));
-
-# [perl #30442] Text::ParseWords does not handle backslashed newline inside quoted text
-$string = qq{"field1" "field2\\\nstill field2" "field3"};
-
-$result = join('|', parse_line("\t", 1, $string));
-is($result, qq{"field1"|"field2\\\nstill field2"|"field3"});
-
-$result = join('|', parse_line("\t", 0, $string));
-is($result, "field1|field2\nstill field2|field3");
-
-SKIP: { # unicode
- skip "No unicode",1 if $]<5.008;
- $string = qq{"field1"\x{1234}"field2\\\x{1234}still field2"\x{1234}"field3"};
- $result = join('|', parse_line("\x{1234}", 0, $string));
- is($result, "field1|field2\x{1234}still field2|field3",'Unicode');
-}
-
-# missing quote after matching regex used to hang after change #22997
-"1234" =~ /(1)(2)(3)(4)/;
-$string = qq{"missing quote};
-$result = join('|', shellwords($string));
-is($result, "");
-
-# make sure shellwords strips out leading whitespace and trailng undefs
-# from parse_line, so it's behavior is more like /bin/sh
-$result = join('|', shellwords(" aa \\ \\ bb ", " \\ ", "cc dd ee\\ "));
-is($result, "aa| | bb| |cc|dd|ee ");
-
-$SIG{ALRM} = sub {die "Timeout!"};
-alarm(3);
-@words = Text::ParseWords::old_shellwords("foo\\");
-is(@words, 1);
-alarm(0);
+#!./perl
+
+use warnings;
+use Text::ParseWords;
+use Test::More tests => 27;
+
+@words = shellwords(qq(foo "bar quiz" zoo));
+is($words[0], 'foo');
+is($words[1], 'bar quiz');
+is($words[2], 'zoo');
+
+{
+ # Gonna get some undefined things back
+ no warnings 'uninitialized' ;
+
+ # Test quotewords() with other parameters and null last field
+ @words = quotewords(':+', 1, 'foo:::"bar:foo":zoo zoo:');
+ is(join(";", @words), qq(foo;"bar:foo";zoo zoo;));
+}
+
+# Test $keep eq 'delimiters' and last field zero
+@words = quotewords('\s+', 'delimiters', '4 3 2 1 0');
+is(join(";", @words), qq(4; ;3; ;2; ;1; ;0));
+
+# Big ol' nasty test (thanks, Joerk!)
+$string = 'aaaa"bbbbb" cc\\ cc \\\\\\"dddd" eee\\\\\\"ffff" "gg"';
+
+# First with $keep == 1
+$result = join('|', parse_line('\s+', 1, $string));
+is($result, 'aaaa"bbbbb"|cc\\ cc|\\\\\\"dddd" eee\\\\\\"ffff"|"gg"');
+
+# Now, $keep == 0
+$result = join('|', parse_line('\s+', 0, $string));
+is($result, 'aaaabbbbb|cc cc|\\"dddd eee\\"ffff|gg');
+
+# Now test single quote behavior
+$string = 'aaaa"bbbbb" cc\\ cc \\\\\\"dddd\' eee\\\\\\"ffff\' gg';
+$result = join('|', parse_line('\s+', 0, $string));
+is($result, 'aaaabbbbb|cc cc|\\"dddd eee\\\\\\"ffff|gg');
+
+# Make sure @nested_quotewords does the right thing
+@lists = nested_quotewords('\s+', 0, 'a b c', '1 2 3', 'x y z');
+is (@lists, 3);
+is (@{$lists[0]}, 3);
+is (@{$lists[1]}, 3);
+is (@{$lists[2]}, 3);
+
+# Now test error return
+$string = 'foo bar baz"bach blech boop';
+
+@words = shellwords($string);
+is(@words, 0);
+
+@words = parse_line('s+', 0, $string);
+is(@words, 0);
+
+@words = quotewords('s+', 0, $string);
+is(@words, 0);
+
+{
+ # Gonna get some more undefined things back
+ no warnings 'uninitialized' ;
+
+ @words = nested_quotewords('s+', 0, $string);
+ is(@words, 0);
+
+ # Now test empty fields
+ $result = join('|', parse_line(':', 0, 'foo::0:"":::'));
+ is($result, 'foo||0||||');
+
+ # Test for 0 in quotes without $keep
+ $result = join('|', parse_line(':', 0, ':"0":'));
+ is($result, '|0|');
+
+ # Test for \001 in quoted string
+ $result = join('|', parse_line(':', 0, ':"' . "\001" . '":'));
+ is($result, "|\1|");
+
+}
+
+# Now test perlish single quote behavior
+$Text::ParseWords::PERL_SINGLE_QUOTE = 1;
+$string = 'aaaa"bbbbb" cc\ cc \\\\\"dddd\' eee\\\\\"\\\'ffff\' gg';
+$result = join('|', parse_line('\s+', 0, $string));
+is($result, 'aaaabbbbb|cc cc|\"dddd eee\\\\"\'ffff|gg');
+
+# test whitespace in the delimiters
+@words = quotewords(' ', 1, '4 3 2 1 0');
+is(join(";", @words), qq(4;3;2;1;0));
+
+# [perl #30442] Text::ParseWords does not handle backslashed newline inside quoted text
+$string = qq{"field1" "field2\\\nstill field2" "field3"};
+
+$result = join('|', parse_line("\t", 1, $string));
+is($result, qq{"field1"|"field2\\\nstill field2"|"field3"});
+
+$result = join('|', parse_line("\t", 0, $string));
+is($result, "field1|field2\nstill field2|field3");
+
+SKIP: { # unicode
+ skip "No unicode",1 if $]<5.008;
+ $string = qq{"field1"\x{1234}"field2\\\x{1234}still field2"\x{1234}"field3"};
+ $result = join('|', parse_line("\x{1234}", 0, $string));
+ is($result, "field1|field2\x{1234}still field2|field3",'Unicode');
+}
+
+# missing quote after matching regex used to hang after change #22997
+"1234" =~ /(1)(2)(3)(4)/;
+$string = qq{"missing quote};
+$result = join('|', shellwords($string));
+is($result, "");
+
+# make sure shellwords strips out leading whitespace and trailng undefs
+# from parse_line, so it's behavior is more like /bin/sh
+$result = join('|', shellwords(" aa \\ \\ bb ", " \\ ", "cc dd ee\\ "));
+is($result, "aa| | bb| |cc|dd|ee ");
+
+$SIG{ALRM} = sub {die "Timeout!"};
+alarm(3);
+@words = Text::ParseWords::old_shellwords("foo\\");
+is(@words, 1);
+alarm(0);
diff --git a/t/porting/customized.dat b/t/porting/customized.dat
index b3e602578f..2a59b86f0e 100644
--- a/t/porting/customized.dat
+++ b/t/porting/customized.dat
@@ -16,7 +16,6 @@ Scalar-List-Utils cpan/Scalar-List-Utils/lib/Sub/Util.pm d87811528ae3587f04e2f09
Scalar-List-Utils cpan/Scalar-List-Utils/ListUtil.xs ed25abc419771d6f3f12323f1f0a372f043d51b2
Socket cpan/Socket/Socket.pm bdc42a2bd5cb560ed1120a3e6f408ed7ece14dce
Socket cpan/Socket/Socket.xs 6102315291684e56e360ff5e0dd237c9394c49b8
-Text::ParseWords cpan/Text-ParseWords/t/ParseWords.t 9bae51c9b944cd5c0bbabe9d397e573976a2be8e
Win32API::File cpan/Win32API-File/buffers.h 02d230ac9ac7091365128161a0ed671898baefae
Win32API::File cpan/Win32API-File/cFile.h fca7e383e76979c3ac3adf12d11d1bcd2618e489
Win32API::File cpan/Win32API-File/cFile.pc 992421eea7782a5957b64f66764f6ffb5093bee4