diff options
Diffstat (limited to 'testsuite/cut.tests')
-rwxr-xr-x | testsuite/cut.tests | 21 |
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. | |||
104 | Apple: you can buy better, but you can't pay more. | 104 | Apple: you can buy better, but you can't pay more. |
105 | Subcalifragilisticexpialidocious. | 105 | Subcalifragilisticexpialidocious. |
106 | Auntie Em: Hate you, hate Kansas. Took the dog. Dorothy." | 106 | Auntie Em: Hate you, hate Kansas. Took the dog. Dorothy." |
107 | |||
108 | optional FEATURE_CUT_REGEX LONG_OPTS | ||
109 | testing "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" | ||
113 | SKIP= | ||
114 | |||
115 | optional LONG_OPTS | ||
116 | testing "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" | ||
107 | SKIP= | 120 | SKIP= |
108 | 121 | ||
109 | testing "cut empty field" "cut -d ':' -f 1-3" \ | 122 | testing "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 | ||
140 | optional LONG_OPTS | ||
127 | testing "cut -dNEWLINE --output-delimiter" \ | 141 | testing "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 | ||
133 | testing "cut -dNEWLINE --output-delimiter 2" \ | 147 | testing "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 | ||
139 | testing "cut -dNEWLINE --output-delimiter EMPTY_INPUT" \ | 153 | testing "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 | "" "" |
158 | SKIP= | ||
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 |