diff options
| author | Xu Cheng | 2015-01-08 13:31:29 +0800 |
|---|---|---|
| committer | Mike McQuaid | 2015-01-08 10:23:45 +0000 |
| commit | 54a45e66eb9bd62a81657f95a2fd7b21a9e01a12 (patch) | |
| tree | ac14e89527e00d47dea33a37e94051ecde5a8634 /Library/Formula | |
| parent | 58c12c95ad63dd7b12cc5e729d2acd7cfc3738d0 (diff) | |
| download | homebrew-54a45e66eb9bd62a81657f95a2fd7b21a9e01a12.tar.bz2 | |
cscope: add test
Closes #35650.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/cscope.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Library/Formula/cscope.rb b/Library/Formula/cscope.rb index cf58956f4..653da980d 100644 --- a/Library/Formula/cscope.rb +++ b/Library/Formula/cscope.rb @@ -11,6 +11,27 @@ class Cscope < Formula "--mandir=#{man}" system "make", "install" 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 + (testpath/"cscope.files").write ("./test.c\n") + system "#{bin}/cscope", "-b", "-k" + assert_match /test\.c.*func/, shell_output("#{bin}/cscope -L1func") + end end __END__ |
