CFG_VER is always a concrete version: dev builds stamp v0.0.0, never "dev"
This commit is contained in:
@@ -122,6 +122,19 @@ func TestSyncSampleAppendsMissingAppVer(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSampleEnvDevStampsConcreteVersion(t *testing.T) {
|
||||
// A dev build must never write CFG_VER=dev: it stamps v0.0.0, and the
|
||||
// next release install upgrades the file to a proper version.
|
||||
dev := SampleEnv("dev", sampleLogPath)
|
||||
if !strings.HasPrefix(dev, "CFG_VER=v0.0.0\n") {
|
||||
t.Errorf("dev sample first line: %q", strings.SplitN(dev, "\n", 2)[0])
|
||||
}
|
||||
out, changed := SyncSample(dev, "v0.1.7", sampleLogPath)
|
||||
if !changed || !strings.HasPrefix(out, "CFG_VER=v0.1.7\n") {
|
||||
t.Errorf("dev-stamped file was not upgraded to v0.1.7 (changed=%v)", changed)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCompareVersions(t *testing.T) {
|
||||
cases := []struct {
|
||||
a, b string
|
||||
|
||||
Reference in New Issue
Block a user