Fix hyphenated issue prefix detection (#199)
- update prefix/number parsing to use the last hyphen across utils and nodb paths - add regression tests covering multi-hyphen prefixes in both packages
This commit is contained in:
@@ -321,6 +321,11 @@ func TestExtractIssuePrefix(t *testing.T) {
|
||||
issueID: "bd-",
|
||||
expected: "bd",
|
||||
},
|
||||
{
|
||||
name: "hyphenated prefix",
|
||||
issueID: "alpha-beta-1",
|
||||
expected: "alpha-beta",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
@@ -379,6 +384,11 @@ func TestExtractIssueNumber(t *testing.T) {
|
||||
issueID: "bd-123abc",
|
||||
expected: 123,
|
||||
},
|
||||
{
|
||||
name: "hyphenated prefix with number",
|
||||
issueID: "alpha-beta-7",
|
||||
expected: 7,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user