splint: add test
Closes Homebrew/homebrew#26479. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
4ea0bdb473
commit
6db9b26668
1 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue