Skip to content

Commit 8b03fe8

Browse files
committed
tests: add simple test using /bin/sh
The /bin/sh executable is expected to always be there, so we use it for simple testing.
1 parent c2e6d82 commit 8b03fe8

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/lddtree_test

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
init_tests \
66
lddtree_usage \
7-
lddtree_version
7+
lddtree_version \
8+
lddtree_sh \
9+
lddtree_sh_flat
810

911
lddtree_usage_body() {
1012
atf_check -o match:"Usage:" lddtree.sh -h
@@ -16,3 +18,20 @@ lddtree_version_body() {
1618
-o match:'lddtree-[0-9]*.[0-9]*' \
1719
lddtree.sh -V
1820
}
21+
22+
# test without -R
23+
lddtree_sh_body() {
24+
atf_check -s exit:0 \
25+
-o match:'sh => /bin/sh \(interpreter .*\)' \
26+
lddtree.sh /bin/sh
27+
}
28+
29+
# test without -R, flat output
30+
# should only output lines prefixed with /
31+
lddtree_sh_flat_body() {
32+
atf_check -s exit:0 \
33+
-o match:'/bin/sh' \
34+
-o not-match:'\(interpreter .*\)' \
35+
-o not-match:'^[^/]' \
36+
lddtree.sh -l /bin/sh
37+
}

0 commit comments

Comments
 (0)