test_bash: tests to assert Bash syntax is valid.
Closes Homebrew/homebrew#47380.
This commit is contained in:
parent
99234f0256
commit
04a9b0022d
16
Library/Homebrew/test/test_bash.rb
Normal file
16
Library/Homebrew/test/test_bash.rb
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
require "testing_env"
|
||||||
|
|
||||||
|
class BashTests < Homebrew::TestCase
|
||||||
|
def assert_valid_bash_syntax(files)
|
||||||
|
output = Utils.popen_read("/bin/bash -n #{files} 2>&1")
|
||||||
|
assert $?.success?, output
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_bin_brew
|
||||||
|
assert_valid_bash_syntax "#{HOMEBREW_LIBRARY_PATH.parent.parent}/bin/brew"
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_bash_cmds
|
||||||
|
assert_valid_bash_syntax "#{HOMEBREW_LIBRARY_PATH}/cmd/*.sh"
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user