From 8ba581e7028a53ad5c2c7b7f86229886f57c927c Mon Sep 17 00:00:00 2001 From: Joseph Manley Date: Mon, 23 Nov 2020 02:21:14 -0500 Subject: [PATCH] Add test for GitLab merge with message in quotes --- semver/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/semver/tests.py b/semver/tests.py index 6383cd0..63025fa 100644 --- a/semver/tests.py +++ b/semver/tests.py @@ -158,6 +158,13 @@ class TestGetCommitMessageRegex(unittest.TestCase): def test_non_merge_message(self): matches = GET_COMMIT_MESSAGE.search("Example unrelated commit message that should get 0 matches") self.assertEqual(matches, None) + def test_gitlab_merge_with_double_quotes(self): + matches = GET_COMMIT_MESSAGE.search("Merge branch 'branch' into 'master'\n\n\"Message in quotes!\"") + if matches: + self.assertEqual(matches.group(4), "master") + self.assertEqual(matches.group(2), "branch") + else: + self.assertTrue(False) class TestVersionBumping(unittest.TestCase): def test_patch_bump(self):