Skip to content

Commit f6c2109

Browse files
committed
Add tests (now passing) from #38
1 parent 6b4c590 commit f6c2109

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

detect_git_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ func TestGitDetector(t *testing.T) {
1010
Output string
1111
}{
1212
{"[email protected]:hashicorp/foo.git", "git::ssh://[email protected]/hashicorp/foo.git"},
13+
{
14+
"[email protected]:org/project.git?ref=test-branch",
15+
"git::ssh://[email protected]/org/project.git?ref=test-branch",
16+
},
1317
{
1418
"[email protected]:hashicorp/foo.git//bar",
1519
"git::ssh://[email protected]/hashicorp/foo.git//bar",
@@ -18,6 +22,22 @@ func TestGitDetector(t *testing.T) {
1822
"[email protected]:hashicorp/foo.git?foo=bar",
1923
"git::ssh://[email protected]/hashicorp/foo.git?foo=bar",
2024
},
25+
{
26+
"[email protected]:org/project.git",
27+
"git::ssh://[email protected]/org/project.git",
28+
},
29+
{
30+
"[email protected]:org/project.git?ref=test-branch",
31+
"git::ssh://[email protected]/org/project.git?ref=test-branch",
32+
},
33+
{
34+
"[email protected]:org/project.git//module/a",
35+
"git::ssh://[email protected]/org/project.git//module/a",
36+
},
37+
{
38+
"[email protected]:org/project.git//module/a?ref=test-branch",
39+
"git::ssh://[email protected]/org/project.git//module/a?ref=test-branch",
40+
},
2141
}
2242

2343
pwd := "/pwd"

0 commit comments

Comments
 (0)