gnu-indent: add test

Closes Homebrew/homebrew#35310.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Xu Cheng 2014-12-28 22:06:35 +08:00 committed by Mike McQuaid
parent 4a693fc4fc
commit a9e567ed4d

View file

@ -1,5 +1,3 @@
require "formula"
class GnuIndent < Formula
homepage "https://www.gnu.org/software/indent/"
url "http://ftpmirror.gnu.org/indent/indent-2.2.10.tar.gz"
@ -28,6 +26,18 @@ class GnuIndent < Formula
system "./configure", *args
system "make", "install"
end
test do
(testpath/"test.c").write("int main(){ return 0; }")
system "#{bin}/gindent", "test.c"
assert_equal File.read("test.c"), <<-EOS.undent
int
main ()
{
return 0;
}
EOS
end
end
__END__