From 2bfa5142466373cb378a1fb2c7673dca1cb6e0b9 Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Fri, 4 Apr 2014 18:24:14 -0700 Subject: [PATCH] pike: add test Closes Homebrew/homebrew#28161. Signed-off-by: Jack Nagel --- Formula/pike.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Formula/pike.rb b/Formula/pike.rb index b176a7d8d7..68a964bb71 100644 --- a/Formula/pike.rb +++ b/Formula/pike.rb @@ -98,4 +98,18 @@ class Pike < Formula bin.install_symlink "#{libexec}/bin/pike" share.install_symlink "#{libexec}/share/man" end + + test do + path = testpath/"test.pike" + path.write <<-EOS.undent + int main() { + for (int i=0; i<10; i++) { write("%d", i); } + return 0; + } + EOS + + out = `#{bin}/pike #{path}` + assert_equal "0123456789", out + assert_equal 0, $?.exitstatus + end end