internal/postgres: add tests for inserting non-release versions
Test are added to TestInsertModulde to verify that a prerelease or
pseudoversion module is inserted correctly.
TryBot-Result: kokoro
Trust: Julie Qiu
Run-TryBot: Julie Qiu
@@ -45,6 +45,14 @@ func TestInsertModule(t *testing.T) {
name: "valid test with internal package",
module: sample.Module(sample.ModulePath, sample.VersionString, "internal/foo"),
},
+ {
+ name: "valid test for prerelease version",
+ module: sample.Module(sample.ModulePath, "v1.0.0-beta", "internal/foo"),
+ },
+ {
+ name: "valid test for pseudoversion version",
+ module: sample.Module(sample.ModulePath, "v0.0.0-20210212193344-7015347762c1", "internal/foo"),
+ },
{
name: "valid test with go.mod missing",
module: func() *internal.Module {
