From 252c2a05946904bc3777715bef229079ea858bbf Mon Sep 17 00:00:00 2001 From: Daniel Leidert Date: Sat, 25 Apr 2020 03:17:01 +0200 Subject: [PATCH] Escape regex characters in paths to match Our paths contains the + sign, which if not escaped changes the match regex and the tests fail. Fixes #8137 --- test/test_convertible.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_convertible.rb b/test/test_convertible.rb index 8c204ebf514..838a0b80b57 100644 --- a/test/test_convertible.rb +++ b/test/test_convertible.rb @@ -32,7 +32,7 @@ class TestConvertible < JekyllUnitTest assert_equal({}, ret) end assert_match(%r!YAML Exception!, out) - assert_match(%r!#{File.join(@base, name)}!, out) + assert_match(%r!#{Regexp.escape(File.join(@base, name))}!, out) end should "raise for broken front matter with `strict_front_matter` set" do @@ -57,7 +57,7 @@ class TestConvertible < JekyllUnitTest assert_equal({}, ret) end assert_match(%r!invalid byte sequence in UTF-8!, out) - assert_match(%r!#{File.join(@base, name)}!, out) + assert_match(%r!#{Regexp.escape(File.join(@base, name))}!, out) end should "parse the front matter but show an error if permalink is empty" do