diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-09-30 18:22:54 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-09-30 18:22:54 +0400 |
commit | 08bc9e01c274a01d107b348f921e1c74dd04bd3a (patch) | |
tree | 25348bff03c29d9dd6c6dd96bf82c7c9f9265ccf /tests/misc/join.pl | |
parent | b9c7373f203ab77c58cb6b131f8b58236ea337a2 (diff) | |
parent | c18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff) | |
download | coreutils-08bc9e01c274a01d107b348f921e1c74dd04bd3a.tar.gz |
Merge tag 'upstream/8.23'
Upstream version 8.23
Diffstat (limited to 'tests/misc/join.pl')
-rwxr-xr-x | tests/misc/join.pl | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/misc/join.pl b/tests/misc/join.pl index 9b93794d..cf3f4bd4 100755 --- a/tests/misc/join.pl +++ b/tests/misc/join.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # Test join. -# Copyright (C) 2008-2013 Free Software Foundation, Inc. +# Copyright (C) 2008-2014 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -275,6 +275,26 @@ my @tv = ( [ "ID1 Name\n1 A\n", ""], "ID1 Name\n1 A\n", 0], +# Zero-terminated lines +['z1', '-z', + ["a\0c\0e\0", "a\0b\0c\0"], "a\0c\0", 0], + +# not zero-terminated, but related to the code change: +# the old readlinebuffer() auto-added '\n' to the last line. +# the new readlinebuffer_delim() does not. +# Ensure it doesn't matter. +['z2', '', + ["a\nc\ne\n", "a\nb\nc"], "a\nc\n", 0], +['z3', '', + ["a\nc\ne", "a\nb\nc"], "a\nc\n", 0], +# missing last NUL at the end of the last line (=end of file) +['z4', '-z', + ["a\0c\0e", "a\0b\0c"], "a\0c\0", 0], +# edge-case: the embedded newlines should treated as +# part of the nul-terminated line +['z5', '-z -a1 -a2', + ["a\n1\0c 3\0","b\n8\0c 9\0"], "a\n1\0b\n8\0c 3 9\0"], + ); # Convert the above old-style test vectors to the newer |