]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add more(1) check
authorSami Kerola <kerolasa@iki.fi>
Sat, 19 Jan 2013 00:08:59 +0000 (00:08 +0000)
committerKarel Zak <kzak@redhat.com>
Thu, 24 Jan 2013 18:30:35 +0000 (19:30 +0100)
[kzak@redhat.com: use test_more program rather than directly more(1)]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/commands.sh
tests/expected/more/regexp [new file with mode: 0644]
tests/expected/more/squeeze [new file with mode: 0644]
tests/ts/more/regexp [new file with mode: 0755]
tests/ts/more/squeeze [new file with mode: 0755]

index c5f714094f431f91a4a7b11cd35c75147de3bbeb..30f0b9b0e917156b0db4d4f665d118d066f958c9 100644 (file)
@@ -23,6 +23,8 @@ TS_HELPER_LIBMOUNT_TABDIFF="$top_builddir/test_mount_tab_diff"
 TS_HELPER_ISLOCAL="$top_builddir/test_islocal"
 TS_HELPER_LOGINDEFS="$top_builddir/test_logindefs"
 
+TS_HELPER_MORE=${TS_HELPER_MORE-"$top_builddir/test_more"}
+
 # TODO: use partx
 TS_HELPER_PARTITIONS="$top_builddir/sample-partitions"
 
diff --git a/tests/expected/more/regexp b/tests/expected/more/regexp
new file mode 100644 (file)
index 0000000..e88c99b
--- /dev/null
@@ -0,0 +1,4 @@
+
+...skipping
+foo
+xyzzy
diff --git a/tests/expected/more/squeeze b/tests/expected/more/squeeze
new file mode 100644 (file)
index 0000000..a1a53b5
--- /dev/null
@@ -0,0 +1,3 @@
+a
+
+b
diff --git a/tests/ts/more/regexp b/tests/ts/more/regexp
new file mode 100755 (executable)
index 0000000..06a00a2
--- /dev/null
@@ -0,0 +1,24 @@
+#!/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="$(dirname $0)/../.."
+TS_DESC="regexp"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+printf "abba\nbar\nfoo\nxyzzy\n" |
+       $TS_HELPER_MORE +/foo > $TS_OUTPUT 2>&1
+
+ts_finalize
diff --git a/tests/ts/more/squeeze b/tests/ts/more/squeeze
new file mode 100755 (executable)
index 0000000..d448fc1
--- /dev/null
@@ -0,0 +1,24 @@
+#!/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="$(dirname $0)/../.."
+TS_DESC="squeeze"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+printf "a\n\n\nb\n" |
+       $TS_HELPER_MORE -s > $TS_OUTPUT 2>&1
+
+ts_finalize