summaryrefslogtreecommitdiffstats
path: root/tests/ts/colcrt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ts/colcrt')
-rw-r--r--tests/ts/colcrt/crash1bin0 -> 314 bytes
-rw-r--r--tests/ts/colcrt/crash2bin0 -> 776 bytes
-rwxr-xr-xtests/ts/colcrt/functional50
-rw-r--r--tests/ts/colcrt/hang11
-rw-r--r--tests/ts/colcrt/nasty-inputbin0 -> 545 bytes
-rwxr-xr-xtests/ts/colcrt/regressions36
-rw-r--r--tests/ts/colcrt/underlines23
7 files changed, 110 insertions, 0 deletions
diff --git a/tests/ts/colcrt/crash1 b/tests/ts/colcrt/crash1
new file mode 100644
index 0000000..6681181
--- /dev/null
+++ b/tests/ts/colcrt/crash1
Binary files differ
diff --git a/tests/ts/colcrt/crash2 b/tests/ts/colcrt/crash2
new file mode 100644
index 0000000..0843cb6
--- /dev/null
+++ b/tests/ts/colcrt/crash2
Binary files differ
diff --git a/tests/ts/colcrt/functional b/tests/ts/colcrt/functional
new file mode 100755
index 0000000..5c97d24
--- /dev/null
+++ b/tests/ts/colcrt/functional
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+#
+# This file is part of util-linux.
+#
+# This file 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 2 of the License, or
+# (at your option) any later version.
+#
+# This file 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.
+#
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="functional"
+
+export LC_CTYPE='C'
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_COLCRT"
+
+ts_init_subtest 'no-options'
+$TS_CMD_COLCRT < $TS_SELF/nasty-input >> $TS_OUTPUT 2>&1
+$TS_CMD_COLCRT < $TS_SELF/underlines >> $TS_OUTPUT 2>&1
+echo "return value: $?" >> $TS_OUTPUT
+ts_finalize_subtest
+
+ts_init_subtest 'no-underlining'
+$TS_CMD_COLCRT --no-underlining < $TS_SELF/nasty-input >> $TS_OUTPUT 2>&1
+$TS_CMD_COLCRT --no-underlining < $TS_SELF/underlines >> $TS_OUTPUT 2>&1
+echo "return value: $?" >> $TS_OUTPUT
+ts_finalize_subtest
+
+ts_init_subtest 'half-lines'
+$TS_CMD_COLCRT --half-lines < $TS_SELF/nasty-input >> $TS_OUTPUT 2>&1
+$TS_CMD_COLCRT --half-lines < $TS_SELF/underlines >> $TS_OUTPUT 2>&1
+echo "return value: $?" >> $TS_OUTPUT
+ts_finalize_subtest
+
+ts_init_subtest 'short-options'
+$TS_CMD_COLCRT - -2 $TS_SELF/nasty-input >> $TS_OUTPUT 2>&1
+$TS_CMD_COLCRT - -2 $TS_SELF/underlines >> $TS_OUTPUT 2>&1
+echo "return value: $?" >> $TS_OUTPUT
+ts_finalize_subtest
+
+ts_finalize
diff --git a/tests/ts/colcrt/hang1 b/tests/ts/colcrt/hang1
new file mode 100644
index 0000000..d26259e
--- /dev/null
+++ b/tests/ts/colcrt/hang1
@@ -0,0 +1 @@
+789:;<=>=>?IABUVNXYZ[_`abcdefgg !"#$%&'()*+,-./01234)*:,-./0123456789:;[=>?1234)*:,-./0123456789:;[=>?4456789:;<=>?IABUVN`abcdefg !" $%&'()*+,-./0123z{|ü~e \ No newline at end of file
diff --git a/tests/ts/colcrt/nasty-input b/tests/ts/colcrt/nasty-input
new file mode 100644
index 0000000..5e541bc
--- /dev/null
+++ b/tests/ts/colcrt/nasty-input
Binary files differ
diff --git a/tests/ts/colcrt/regressions b/tests/ts/colcrt/regressions
new file mode 100755
index 0000000..394c4e8
--- /dev/null
+++ b/tests/ts/colcrt/regressions
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+#
+# This file is part of util-linux.
+#
+# This file 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 2 of the License, or
+# (at your option) any later version.
+#
+# This file 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.
+#
+TS_TOPDIR="${0%/*}/../.."
+TS_DESC="regressions"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_COLCRT"
+ts_check_prog "timeout"
+
+check_input_file() {
+ ts_init_subtest ${1##*/}
+ timeout 2 $TS_CMD_COLCRT < $1 > $TS_OUTPUT 2>&1
+ echo "return value: $?" >> $TS_OUTPUT
+ ts_finalize_subtest
+}
+
+check_input_file "$TS_SELF/crash1"
+check_input_file "$TS_SELF/crash2"
+check_input_file "$TS_SELF/hang1"
+
+ts_finalize
diff --git a/tests/ts/colcrt/underlines b/tests/ts/colcrt/underlines
new file mode 100644
index 0000000..940c7a8
--- /dev/null
+++ b/tests/ts/colcrt/underlines
@@ -0,0 +1,23 @@
+ 200 ___
+ 201 abc
+ 202 _abc
+ 203 a_bc
+ 204 ab_c
+ 205 abc_
+ 206 __abc
+ 207 a__bc
+ 208 ab__c
+ 209 abc__
+ 210 _a_bc
+ 211 _ab_c
+ 212 a_b_c
+ 213 a__bc
+ 214 a_bc_
+ 215 abc__
+ 216 _abc_
+ 217 _a_b_c
+ 218 _a__bc
+ 219 a__bc_
+ 220 _abc__
+ 221 ___abc
+ 222 abc___