astyle: add test

Closes Homebrew/homebrew#35333.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Xu Cheng 2014-12-29 15:45:57 +08:00 committed by Mike McQuaid
parent 4a76112891
commit e25e352abe

View file

@ -1,5 +1,3 @@
require "formula"
class Astyle < Formula
homepage "http://astyle.sourceforge.net/"
url "https://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05/astyle_2.05_macosx.tar.gz"
@ -19,4 +17,16 @@ class Astyle < Formula
bin.install "bin/astyle"
end
end
test do
(testpath/"test.c").write("int main(){return 0;}\n")
system "#{bin}/astyle", "--style=gnu", "--indent=spaces=4",
"--lineend=linux", "#{testpath}/test.c"
assert_equal File.read("test.c"), <<-EOS.undent
int main()
{
return 0;
}
EOS
end
end