aboutsummaryrefslogtreecommitdiff
path: root/testsuite/cut.tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/cut.tests')
-rwxr-xr-xtestsuite/cut.tests21
1 files changed, 18 insertions, 3 deletions
diff --git a/testsuite/cut.tests b/testsuite/cut.tests
index 52d05fde3..e57b028ac 100755
--- a/testsuite/cut.tests
+++ b/testsuite/cut.tests
@@ -104,6 +104,19 @@ Weather forecast for tonight : dark.
104Apple: you can buy better, but you can't pay more. 104Apple: you can buy better, but you can't pay more.
105Subcalifragilisticexpialidocious. 105Subcalifragilisticexpialidocious.
106Auntie Em: Hate you, hate Kansas. Took the dog. Dorothy." 106Auntie Em: Hate you, hate Kansas. Took the dog. Dorothy."
107
108optional FEATURE_CUT_REGEX LONG_OPTS
109testing "cut -F preserves intermediate delimiters" \
110 "cut --output-delimiter=: -F2,4-6,7" \
111 "2:4 5 6:7\n" \
112 "" "1 2 3 4\t\t5 6 7 8\n"
113SKIP=
114
115optional LONG_OPTS
116testing "cut -f does not preserve intermediate delimiters" \
117 "cut --output-delimiter=: -d' ' -f2,4-6,7" \
118 "2:4:5:6:7\n" \
119 "" "1 2 3 4 5 6 7 8\n"
107SKIP= 120SKIP=
108 121
109testing "cut empty field" "cut -d ':' -f 1-3" \ 122testing "cut empty field" "cut -d ':' -f 1-3" \
@@ -124,23 +137,25 @@ testing "cut -dNEWLINE" \
124 "2\n4\n6\n7\n" \ 137 "2\n4\n6\n7\n" \
125 "" "1\n2\n3\n4\n5\n6\n7" 138 "" "1\n2\n3\n4\n5\n6\n7"
126 139
140optional LONG_OPTS
127testing "cut -dNEWLINE --output-delimiter" \ 141testing "cut -dNEWLINE --output-delimiter" \
128 "cut -d' 142 "cut -d'
129' -O@@ -f4,2,6-8" \ 143' --output-delimiter=@@ -f4,2,6-8" \
130 "2@@4@@6@@7\n" \ 144 "2@@4@@6@@7\n" \
131 "" "1\n2\n3\n4\n5\n6\n7" 145 "" "1\n2\n3\n4\n5\n6\n7"
132 146
133testing "cut -dNEWLINE --output-delimiter 2" \ 147testing "cut -dNEWLINE --output-delimiter 2" \
134 "cut -d' 148 "cut -d'
135' -O@@ -f4,2,6-8" \ 149' --output-delimiter=@@ -f4,2,6-8" \
136 "2@@4@@6@@7\n" \ 150 "2@@4@@6@@7\n" \
137 "" "1\n2\n3\n4\n5\n6\n7\n" 151 "" "1\n2\n3\n4\n5\n6\n7\n"
138 152
139testing "cut -dNEWLINE --output-delimiter EMPTY_INPUT" \ 153testing "cut -dNEWLINE --output-delimiter EMPTY_INPUT" \
140 "cut -d' 154 "cut -d'
141' -O@@ -f4,2,6-8" \ 155' --output-delimiter=@@ -f4,2,6-8" \
142 "" \ 156 "" \
143 "" "" 157 "" ""
158SKIP=
144 159
145# This seems to work as if delimiter is never found. 160# This seems to work as if delimiter is never found.
146# We test here that -d '' does *not* operate as if there was no -d 161# We test here that -d '' does *not* operate as if there was no -d