]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ul: add basic tests
authorSami Kerola <kerolasa@iki.fi>
Sat, 1 Aug 2020 12:20:30 +0000 (13:20 +0100)
committerSami Kerola <kerolasa@iki.fi>
Tue, 20 Oct 2020 19:29:20 +0000 (20:29 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests/expected/ul/basic [new file with mode: 0644]
tests/ts/ul/basic [new file with mode: 0755]
tests/ts/ul/basic.input [new file with mode: 0644]
tests/ts/ul/filter.input [new file with mode: 0644]

diff --git a/tests/expected/ul/basic b/tests/expected/ul/basic
new file mode 100644 (file)
index 0000000..4a6cdd6
--- /dev/null
@@ -0,0 +1,113 @@
+printable characters
+!
+"
+#
+$
+%
+&
+'
+(
+)
+*
++
+,
+-
+.
+/
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+:
+;
+<
+=
+>
+?
+@
+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
+[
+\
+]
+^
+_
+`
+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
+{
+|
+}
+~
+filter input
+backspacex
+        tab
+R
+SO
+\e[7mSI\e(B\e[m
+\e[4munder\e[24mline
+flush
+\fafer flush
+normal\e[2mdim\e(B\e[m
+normaldimunderlined
+normal
+\e[A\e[A\e[C\e[C\e[C\e[C\e[C\e[Creverse
+eof
+indicated
+ul
+__
diff --git a/tests/ts/ul/basic b/tests/ts/ul/basic
new file mode 100755 (executable)
index 0000000..bc0c116
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#
+# Copyright (C) 2020 Sami Kerola <kerolasa@iki.fi>
+#
+# 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="basic tests"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_UL"
+
+ts_log "printable characters"
+$TS_CMD_UL < $TS_SELF/basic.input >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+ts_log "filter input"
+$TS_CMD_UL $TS_SELF/filter.input >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+ts_log "indicated"
+printf "u\b_l\b_\n" | ul --indicated >> $TS_OUTPUT 2>> $TS_ERRLOG
+
+ts_finalize
diff --git a/tests/ts/ul/basic.input b/tests/ts/ul/basic.input
new file mode 100644 (file)
index 0000000..3bc7fbc
--- /dev/null
@@ -0,0 +1,95 @@
+!
+"
+#
+$
+%
+&
+'
+(
+)
+*
++
+,
+-
+.
+/
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+:
+;
+<
+=
+>
+?
+@
+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
+[
+\
+]
+^
+_
+`
+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
+{
+|
+}
+~
diff --git a/tests/ts/ul/filter.input b/tests/ts/ul/filter.input
new file mode 100644 (file)
index 0000000..c900595
--- /dev/null
@@ -0,0 +1,11 @@
+backspacex\by
+       tab
+R\rS
+SO\ e
+SI\ f
+u\b_n\b_d\b_e\b_r\b_line
+flush\fafer flush
+normal\e9dim
+normal\e8dimunderlined
+normal\e7reverse
+eof