From f6c2109d9221ed36d2f28c471835c4fac31f586e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 16 Nov 2018 20:54:05 -0800 Subject: [PATCH] Add tests (now passing) from #38 --- detect_git_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/detect_git_test.go b/detect_git_test.go index c899be0b8..0d1b9540c 100644 --- a/detect_git_test.go +++ b/detect_git_test.go @@ -10,6 +10,10 @@ func TestGitDetector(t *testing.T) { Output string }{ {"git@github.com:hashicorp/foo.git", "git::ssh://git@github.com/hashicorp/foo.git"}, + { + "git@github.com:org/project.git?ref=test-branch", + "git::ssh://git@github.com/org/project.git?ref=test-branch", + }, { "git@github.com:hashicorp/foo.git//bar", "git::ssh://git@github.com/hashicorp/foo.git//bar", @@ -18,6 +22,22 @@ func TestGitDetector(t *testing.T) { "git@github.com:hashicorp/foo.git?foo=bar", "git::ssh://git@github.com/hashicorp/foo.git?foo=bar", }, + { + "git@github.xyz.com:org/project.git", + "git::ssh://git@github.xyz.com/org/project.git", + }, + { + "git@github.xyz.com:org/project.git?ref=test-branch", + "git::ssh://git@github.xyz.com/org/project.git?ref=test-branch", + }, + { + "git@github.xyz.com:org/project.git//module/a", + "git::ssh://git@github.xyz.com/org/project.git//module/a", + }, + { + "git@github.xyz.com:org/project.git//module/a?ref=test-branch", + "git::ssh://git@github.xyz.com/org/project.git//module/a?ref=test-branch", + }, } pwd := "/pwd"