astyle: add test
Closes Homebrew/homebrew#35333. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
4a76112891
commit
e25e352abe
1 changed files with 12 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue