(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestDefaultWorkspaceFolder(t *testing.T) { |
| 16 | t.Parallel() |
| 17 | |
| 18 | successTests := []struct { |
| 19 | name string |
| 20 | baseDir string |
| 21 | gitURL string |
| 22 | expected string |
| 23 | }{ |
| 24 | { |
| 25 | name: "HTTP", |
| 26 | baseDir: "/workspaces", |
| 27 | gitURL: "https://github.com/coder/envbuilder.git", |
| 28 | expected: "/workspaces/envbuilder", |
| 29 | }, |
| 30 | { |
| 31 | name: "SSH", |
| 32 | baseDir: "/workspaces", |
| 33 | gitURL: "git@github.com:coder/envbuilder.git", |
| 34 | expected: "/workspaces/envbuilder", |
| 35 | }, |
| 36 | { |
| 37 | name: "SSH with scheme", |
| 38 | baseDir: "/workspaces", |
| 39 | gitURL: "ssh://git@github.com/coder/envbuilder.git", |
| 40 | expected: "/workspaces/envbuilder", |
| 41 | }, |
| 42 | { |
| 43 | name: "Git protocol is SSH", |
| 44 | baseDir: "/workspaces", |
| 45 | gitURL: "git://github.com/coder/envbuilder.git", |
| 46 | expected: "/workspaces/envbuilder", |
| 47 | }, |
| 48 | { |
| 49 | name: "Git+SSH", |
| 50 | baseDir: "/workspaces", |
| 51 | gitURL: "git+ssh://github.com/coder/envbuilder.git", |
| 52 | expected: "/workspaces/envbuilder", |
| 53 | }, |
| 54 | { |
| 55 | name: "username and password", |
| 56 | baseDir: "/workspaces", |
| 57 | gitURL: "https://username:password@github.com/coder/envbuilder.git", |
| 58 | expected: "/workspaces/envbuilder", |
| 59 | }, |
| 60 | { |
| 61 | name: "trailing", |
| 62 | baseDir: "/workspaces", |
| 63 | gitURL: "https://github.com/coder/envbuilder.git/", |
| 64 | expected: "/workspaces/envbuilder", |
| 65 | }, |
| 66 | { |
| 67 | name: "trailing-x2", |
| 68 | baseDir: "/workspaces", |
| 69 | gitURL: "https://github.com/coder/envbuilder.git//", |
| 70 | expected: "/workspaces/envbuilder", |
| 71 | }, |
| 72 | { |
nothing calls this directly
no test coverage detected