aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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