]> err.no Git - util-linux/commitdiff
tests: add look test for words with separator
authorKarel Zak <kzak@redhat.com>
Tue, 6 Mar 2007 12:04:25 +0000 (13:04 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 6 Mar 2007 12:04:25 +0000 (13:04 +0100)
$ look apple-pie

Signed-off-by: Karel Zak <kzak@redhat.com>
tests/Makefile.am
tests/commands.sh.in
tests/expected/ts-look-separator [new file with mode: 0644]
tests/ts-look-separator [new file with mode: 0755]

index e448994eacff7d3d1d99fda7e534264ea1393234..02f47e8b644a0d209d1aa8031410b9057694cca4 100644 (file)
@@ -15,7 +15,8 @@ EXTRA_DIST =  expected/* \
                ts-mkswap-doit \
                ts-mount-paths \
                ts-namei-logic \
-               ts-cramfs-mkfs
+               ts-cramfs-mkfs \
+               ts-look-separator
 
 distclean-local:
        rm -rf output diff
index 435446b318d73d16e5f585cec8354020c673f79d..de329032cf9983ef562f92b63cafc110c314bf46 100644 (file)
@@ -19,5 +19,5 @@ TS_CMD_IPCS=${TS_CMD_IPCS:-"$TOPDIR/sys-utils/ipcs"}
 TS_CMD_COL=${TS_CMD_COL:-"$TOPDIR/text-utils/col"}
 
 TS_CMD_NAMEI=${TS_CMD_NAMEI-"$TOPDIR/misc-utils/namei"}
-
+TS_CMD_LOOK=${TS_CMD_LOOK-"$TOPDIR/misc-utils/look"}
 
diff --git a/tests/expected/ts-look-separator b/tests/expected/ts-look-separator
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/ts-look-separator b/tests/ts-look-separator
new file mode 100755 (executable)
index 0000000..d86e707
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+#
+# WARNING: the look command expects that the /usr/share/dict/words uses
+#          directory order!
+#
+# for example:
+#
+#      cat words.raw | egrep --invert-match "'s$" | \
+#              egrep  "^[[:alnum:]'&!,./-]+$" | \
+#              sort --ignore-case --dictionary-order | \
+#              uniq >  words
+#
+
+. commands.sh
+. functions.sh
+
+TS_COMPONENT="look"
+TS_DESC="separator"
+
+ts_init
+
+if [ ! -f "/usr/share/dict/words" ]; then
+       ts_ignore "/usr/share/dict/words not such file" 
+fi
+
+touch $TS_OUTPUT
+
+$TS_CMD_LOOK apple-pie >> $TS_OUTPUT
+
+ts_finalize
+