aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
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