Go now stamps local builds with a module pseudo-version (v0.1.3-0.20261014174204-1c31a75d0507+dirty), so the version showed that instead of dev-<commit> as the docs say. The update check also took it for a pre-release of 0.1.3, a version that doesn't exist, rather than a development build. A pseudo-version is now dev-<its commit>, -dirty with uncommitted changes; real versions are unchanged. Reviewed-on: #68 Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
23 lines
570 B
Go
23 lines
570 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func TestPseudoVersions(t *testing.T) {
|
|
for v, want := range map[string]string{
|
|
"v0.1.3-0.20261014174204-1c31a75d0507": "1c31a75d0507",
|
|
"v0.1.3-0.20261014174204-1c31a75d0507+dirty": "1c31a75d0507",
|
|
"v0.0.0-20261014174204-1c31a75d0507": "1c31a75d0507",
|
|
"v0.2.0-rc.1.0.20261014174204-1c31a75d0507": "1c31a75d0507",
|
|
"v0.1.2": "",
|
|
"v0.2.0-rc.1": "",
|
|
} {
|
|
got := ""
|
|
if m := pseudo.FindStringSubmatch(v); m != nil {
|
|
got = m[1]
|
|
}
|
|
if got != want {
|
|
t.Errorf("%s: %q, want %q", v, got, want)
|
|
}
|
|
}
|
|
}
|