aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Fontaine2016-02-02 14:50:27 +0100
committerBaptiste Fontaine2016-02-03 14:04:31 +0100
commitabf75cd08fdc8190e9ef0c5fca2c22b3236e9439 (patch)
treed99dfd45e562e92a866ba6ddda9e6fe5b9ecdb4c
parentcdd990f9d70b83956d931b4f48d6f9c3ba53023a (diff)
downloadbrew-abf75cd08fdc8190e9ef0c5fca2c22b3236e9439.tar.bz2
tests: add audit regression test for Homebrew/homebrew#48744
Closes Homebrew/homebrew#48748. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
-rw-r--r--Library/Homebrew/test/test_cmd_audit.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_cmd_audit.rb b/Library/Homebrew/test/test_cmd_audit.rb
index cc10cdee9..0dbfbe5e6 100644
--- a/Library/Homebrew/test/test_cmd_audit.rb
+++ b/Library/Homebrew/test/test_cmd_audit.rb
@@ -299,4 +299,21 @@ class FormulaAuditorTests < Homebrew::TestCase
fa.audit_line 'ohai share/"bar"', 3
assert_equal [], fa.problems
end
+
+ # Regression test for https://github.com/Homebrew/homebrew/pull/48744
+ # Formulae with "++" in their name would break the name check because of a
+ # regexp error:
+ # Error: nested *?+ in regexp: /^libxml++3\s/
+ def test_audit_desc_plus_plus_name
+ fa = formula_auditor "foolibc++", <<-EOS.undent, :strict => true
+ class Foolibcxx < Formula
+ desc "foolibc++ is a test"
+ url "http://example.com/foo-1.0.tgz"
+ end
+ EOS
+
+ fa.audit_desc
+ assert_equal "Description shouldn't include the formula name",
+ fa.problems.shift
+ end
end