summaryrefslogtreecommitdiff
path: root/tests/split
diff options
context:
space:
mode:
Diffstat (limited to 'tests/split')
-rwxr-xr-xtests/split/additional-suffix.sh (renamed from tests/split/additional-suffix)4
-rwxr-xr-xtests/split/b-chunk.sh (renamed from tests/split/b-chunk)4
-rwxr-xr-xtests/split/fail.sh (renamed from tests/split/fail)4
-rwxr-xr-xtests/split/filter.sh (renamed from tests/split/filter)6
-rwxr-xr-xtests/split/guard-input.sh33
-rwxr-xr-xtests/split/l-chunk.sh (renamed from tests/split/l-chunk)4
-rwxr-xr-xtests/split/lines.sh (renamed from tests/split/lines)4
-rwxr-xr-xtests/split/numeric.sh (renamed from tests/split/numeric)4
-rwxr-xr-xtests/split/r-chunk.sh (renamed from tests/split/r-chunk)4
-rwxr-xr-xtests/split/suffix-auto-length.sh (renamed from tests/split/suffix-auto-length)4
-rwxr-xr-xtests/split/suffix-length.sh (renamed from tests/split/suffix-length)4
11 files changed, 54 insertions, 21 deletions
diff --git a/tests/split/additional-suffix b/tests/split/additional-suffix.sh
index 8cfd3c1e..73fcdc49 100755
--- a/tests/split/additional-suffix
+++ b/tests/split/additional-suffix.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# show that 'split --additional-suffix=SUFFIX' works.
-# Copyright (C) 2012 Free Software Foundation, Inc.
+# Copyright (C) 2012-2013 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
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
printf '1\n2\n3\n4\n5\n' > in || framework_failure_
diff --git a/tests/split/b-chunk b/tests/split/b-chunk.sh
index dd8b6cbd..e80699fd 100755
--- a/tests/split/b-chunk
+++ b/tests/split/b-chunk.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# test splitting into 3 chunks
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2010-2013 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
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
# N can be greater than the file size
diff --git a/tests/split/fail b/tests/split/fail.sh
index 83251e9e..6272e9b5 100755
--- a/tests/split/fail
+++ b/tests/split/fail.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# split must fail when given length/count of zero.
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 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
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
getlimits_
diff --git a/tests/split/filter b/tests/split/filter.sh
index dbcac5f7..3520b7af 100755
--- a/tests/split/filter
+++ b/tests/split/filter.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Exercise split's new --filter option.
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 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
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
xz --version || skip_ "xz (better than gzip/bzip2) required"
@@ -29,7 +29,7 @@ for total_n_lines in 5 3000 20000; do
# and would provide little added benefit.
case $i:$total_n_lines in 2:5);; *) continue;; esac
- split -l$i --filter='xz > $FILE.xz' in out- || fail=1
+ split -l$i --filter='xz -1 > $FILE.xz' in out- || fail=1
xz -dc out-* > out || fail=1
compare in out || fail=1
rm -f out*
diff --git a/tests/split/guard-input.sh b/tests/split/guard-input.sh
new file mode 100755
index 00000000..357ed543
--- /dev/null
+++ b/tests/split/guard-input.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# ensure split doesn't overwrite input with output.
+
+# Copyright (C) 2012-2013 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ split
+
+seq 10 | tee exp-1 > xaa
+ln -s xaa in2
+ln xaa in3
+
+split -C 6 xaa && fail=1
+split -C 6 in2 && fail=1
+split -C 6 in3 && fail=1
+split -C 6 - < xaa && fail=1
+
+compare exp-1 xaa || fail=1
+
+Exit $fail
diff --git a/tests/split/l-chunk b/tests/split/l-chunk.sh
index 8199883a..63968d15 100755
--- a/tests/split/l-chunk
+++ b/tests/split/l-chunk.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# test splitting into newline delineated chunks (-n l/...)
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2010-2013 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
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
# invalid number of chunks
diff --git a/tests/split/lines b/tests/split/lines.sh
index 35eb3eb2..d78bc202 100755
--- a/tests/split/lines
+++ b/tests/split/lines.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# show that 'split --lines=2' works.
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 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
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
printf '1\n2\n3\n4\n5\n' > in || framework_failure_
diff --git a/tests/split/numeric b/tests/split/numeric.sh
index ad22df62..1fd9b6f5 100755
--- a/tests/split/numeric
+++ b/tests/split/numeric.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Show that split --numeric-suffixes[=from] works.
-# Copyright (C) 2012 Free Software Foundation, Inc.
+# Copyright (C) 2012-2013 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
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
# Check default start from 0
diff --git a/tests/split/r-chunk b/tests/split/r-chunk.sh
index afd9bf4b..f4c4fd22 100755
--- a/tests/split/r-chunk
+++ b/tests/split/r-chunk.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# test splitting into round-robin chunks
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2010-2013 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
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
require_ulimit_
diff --git a/tests/split/suffix-auto-length b/tests/split/suffix-auto-length.sh
index dacc9515..4beab031 100755
--- a/tests/split/suffix-auto-length
+++ b/tests/split/suffix-auto-length.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Test the suffix auto widening functionality
-# Copyright (C) 2012 Free Software Foundation, Inc.
+# Copyright (C) 2012-2013 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
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
diff --git a/tests/split/suffix-length b/tests/split/suffix-length.sh
index bc65e9f6..466d8a7c 100755
--- a/tests/split/suffix-length
+++ b/tests/split/suffix-length.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Show that split -a works.
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 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
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
a_z='a b c d e f g h i j k l m n o p q r s t u v w x y z'