Clean up tests

Signed-off-by: Joel Longtine <joel@longtine.io>
This commit is contained in:
Joel Longtine 2021-12-13 16:21:08 -07:00
parent 870410be51
commit ec427aff66

View File

@ -95,50 +95,59 @@ func TestParseArgument(t *testing.T) {
}, },
}, },
{ {
name: "Unspecified provider without folder", name: "Custom git provider without folder",
in: "dagger.io/dagger/universe.git@main", in: "git.blocklayer.com/dagger/universe.git@main",
want: &Require{ want: &Require{
repo: "dagger.io/dagger/universe.git", repo: "git.blocklayer.com/dagger/universe.git",
path: "", path: "",
version: "main", version: "main",
}, },
}, },
{ {
name: "Unspecified provider without folder", name: "Custom git provider with folder and version",
in: "dagger.io/dagger/universe.git/stdlib/alpha.dagger.io/dagger@v0.1.0", in: "git.blocklayer.com/dagger/universe.git/stdlib/alpha.dagger.io/dagger@v0.1.0",
want: &Require{ want: &Require{
repo: "dagger.io/dagger/universe.git", repo: "git.blocklayer.com/dagger/universe.git",
path: "/stdlib/alpha.dagger.io/dagger", path: "/stdlib/alpha.dagger.io/dagger",
version: "v0.1.0", version: "v0.1.0",
}, },
}, },
{ {
name: "Unspecified provider without folder", name: "Custom git provider with folder and version",
in: "dagger.io/dagger/universe.git/stdlib@v5", in: "git.blocklayer.com/dagger/universe.git/stdlib@v5",
want: &Require{ want: &Require{
repo: "dagger.io/dagger/universe.git", repo: "git.blocklayer.com/dagger/universe.git",
path: "/stdlib", path: "/stdlib",
version: "v5", version: "v5",
}, },
}, },
{ {
name: "Unspecified provider without folder", name: "Custom git provider without folder",
in: "dagger.io/dagger/universe.git", in: "git.blocklayer.com/dagger/universe.git",
want: &Require{ want: &Require{
repo: "dagger.io/dagger/universe.git", repo: "git.blocklayer.com/dagger/universe.git",
path: "", path: "",
version: "", version: "",
}, },
}, },
{ {
name: "Unspecified provider without folder", name: "Custom git provider with folder, no version",
in: "dagger.io/dagger/universe.git/stdlib/alpha.dagger.io/dagger", in: "git.blocklayer.com/dagger/universe.git/stdlib/alpha.dagger.io/dagger",
want: &Require{ want: &Require{
repo: "dagger.io/dagger/universe.git", repo: "git.blocklayer.com/dagger/universe.git",
path: "/stdlib/alpha.dagger.io/dagger", path: "/stdlib/alpha.dagger.io/dagger",
version: "", version: "",
}, },
}, },
{
name: "Custom git provider with custom port, folder, and version",
in: "git.blocklayer.com:7999/ops/dagger.git/stuff/here@v5",
want: &Require{
repo: "git.blocklayer.com:7999/ops/dagger.git",
path: "/stuff/here",
version: "v5",
},
},
// TODO: Add more tests for ports! // TODO: Add more tests for ports!
} }