[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-525-ge4cdcca
Igor Murzov
e-mail at date.by
Wed Nov 9 13:12:12 UTC 2011
The following commit has been merged in the master branch:
commit d48d9ebd2f5013cdacf9657b0d240c5905045fa7
Author: Igor Murzov <e-mail at date.by>
Date: Tue Nov 8 04:00:46 2011 +0300
testsuite: Add some make test cases.
diff --git a/test/fixtures/make/Makefile b/test/fixtures/make/Makefile
new file mode 100644
index 0000000..1a6416c
--- /dev/null
+++ b/test/fixtures/make/Makefile
@@ -0,0 +1,16 @@
+NAME := sample
+
+.PHONY: all
+all: $(NAME)
+
+$(NAME): sample.c
+ cc -o $@ $^
+
+.PHONY: install
+install: all
+ mkdir -p /usr/bin
+ install -m 755 $(NAME) /usr/bin
+
+.PHONY: clean
+clean:
+ -rm -f $(NAME)
diff --git a/test/fixtures/_filedir/a b/i b/test/fixtures/make/empty_dir/.nothing_here
similarity index 100%
copy from test/fixtures/_filedir/a b/i
copy to test/fixtures/make/empty_dir/.nothing_here
diff --git a/test/fixtures/make/sample.c b/test/fixtures/make/sample.c
new file mode 100644
index 0000000..2be4600
--- /dev/null
+++ b/test/fixtures/make/sample.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(void)
+{
+ puts("Hello, world!");
+ return 0;
+}
diff --git a/test/lib/completions/make.exp b/test/lib/completions/make.exp
index 64a393d..f20ace1 100644
--- a/test/lib/completions/make.exp
+++ b/test/lib/completions/make.exp
@@ -4,14 +4,33 @@ proc setup {} {
proc teardown {} {
- assert_env_unmodified
+ assert_env_unmodified {/OLDPWD=/d}
}
setup
-assert_complete_any "make "
+set test "-f Ma<TAB> should complete \"Makefile\""
+set dir $::srcdir/fixtures/make
+assert_complete_dir "Makefile" "make -f Ma" $dir $test
+
+
+sync_after_int
+
+
+set test "\"make <TAB>\" should complete targets"
+set dir $::srcdir/fixtures/make
+set targets "all sample install clean"
+assert_complete_dir $targets "make " $dir $test
+
+
+sync_after_int
+
+
+set test "\"make <TAB>\" should not show anything in directory without makefile"
+set dir $::srcdir/fixtures/make/empty_dir
+assert_complete_dir "" "make " $dir $test
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list