Skip to content

Commit 9d18c1c

Browse files
test: add validity test for uppercase scopes
1 parent 669cd46 commit 9d18c1c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_format.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,20 @@ def test_r_scope__scopes(conventional_commit_scope_required):
459459
assert not regex.match("(api; client)")
460460

461461

462+
def test_r_scope__scopes_uppercase(conventional_commit_scope_required):
463+
conventional_commit_scope_required.scopes = ["api", "client"]
464+
regex = re.compile(conventional_commit_scope_required.r_scope)
465+
466+
assert regex.match("(API)")
467+
assert regex.match("(CLIENT)")
468+
assert regex.match("(API, CLIENT)")
469+
assert regex.match("(API: CLIENT)")
470+
assert regex.match("(API/CLIENT)")
471+
assert regex.match("(API-CLIENT)")
472+
assert not regex.match("(TEST)")
473+
assert not regex.match("(API; CLIENT)")
474+
475+
462476
def test_r_delim(conventional_commit):
463477
regex = re.compile(conventional_commit.r_delim)
464478

0 commit comments

Comments
 (0)