aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorXu Cheng2015-01-08 13:39:22 +0800
committerMike McQuaid2015-01-08 10:24:10 +0000
commit57e81f0d055e26d5c484990394debc4ce21735d5 (patch)
tree6c6788d7c6e21b67255233077859895081776a33 /Library/Formula
parentf5ea9670abeaa471a48369a49d8d62b725969863 (diff)
downloadhomebrew-57e81f0d055e26d5c484990394debc4ce21735d5.tar.bz2
ctags: add test
Closes #35651. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/ctags.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/Library/Formula/ctags.rb b/Library/Formula/ctags.rb
index 8bb775ed3..899e5a8eb 100644
--- a/Library/Formula/ctags.rb
+++ b/Library/Formula/ctags.rb
@@ -36,6 +36,26 @@ class Ctags < Formula
link.
EOS
end
+
+ test do
+ (testpath/"test.c").write <<-EOS.undent
+ #include <stdio.h>
+ #include <stdlib.h>
+
+ void func()
+ {
+ printf("Hello World!");
+ }
+
+ int main()
+ {
+ func();
+ return 0;
+ }
+ EOS
+ system "#{bin}/ctags", "-R", "."
+ assert_match /func.*test\.c/, File.read("tags")
+ end
end
__END__