aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMike Naberezny2014-02-06 10:41:39 -0800
committerMike McQuaid2014-02-06 19:25:22 +0000
commit9bf76302a2fd757f24f89d6adfc7a3aa413c8fb7 (patch)
treee49cb1b731ea316f52e8b0708a1b1fde511a0aa7 /Library/Formula
parentf48489133c4f00f957f46c2310364dfffd426a97 (diff)
downloadhomebrew-9bf76302a2fd757f24f89d6adfc7a3aa413c8fb7.tar.bz2
splint: add test
Closes #26479. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/splint.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/Library/Formula/splint.rb b/Library/Formula/splint.rb
index fae225a97..45f951067 100644
--- a/Library/Formula/splint.rb
+++ b/Library/Formula/splint.rb
@@ -19,6 +19,23 @@ class Splint < Formula
system "make"
system "make install"
end
+
+ test do
+ path = testpath/"test.c"
+ path.write <<-EOS.undent
+ #include <stdio.h>
+ int main()
+ {
+ char c;
+ printf("%c", c);
+ return 0;
+ }
+ EOS
+
+ output = `#{bin}/splint #{path} 2>&1`
+ assert output.include?("5:18: Variable c used before definition")
+ assert_equal 1, $?.exitstatus
+ end
end