Skip to content

Commit 5708a67

Browse files
Copilotmroth
andauthored
Add negative test cases for near-miss hostnames in parseGithubRemote
Agent-Logs-Url: https://github.com/mroth/bump/sessions/5418106b-c2a5-4f1c-a03c-69d7394d03ee Co-authored-by: mroth <40650+mroth@users.noreply.github.com>
1 parent 2874544 commit 5708a67

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

git_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ func Test_parseGithubRemote(t *testing.T) {
3131
wantRepo: "bump",
3232
wantOk: true,
3333
},
34+
// negative cases: near-miss hostnames should not match
35+
{
36+
name: "nearMiss_HTTPS_dotReplaced",
37+
remoteURL: "https://githubXcom/mroth/bump.git",
38+
wantOk: false,
39+
},
40+
{
41+
name: "nearMiss_SSH_dotReplaced",
42+
remoteURL: "git@githubXcom:mroth/bump.git",
43+
wantOk: false,
44+
},
3445
}
3546
for _, tt := range tests {
3647
t.Run(tt.name, func(t *testing.T) {

0 commit comments

Comments
 (0)