Files
jcoffey-dev a7de7a517d
ci / test (pull_request) Successful in 1m25s
Tag releases with the suite's numbers: v27.1-rc.1
The installer joins the INBUXA suite's release numbers: v27.1 for a series,
v27.1.3 for a patch, v27.1-rc.1 for a release candidate.

- build-release.sh accepts those tags, and still the dated ones, so an
  old release can be rebuilt.
- release.yml publishes a release candidate as a pre-release, so
  releases/latest stays on the last final release.
- The host server counts as the pinned release only when its --version
  is exactly the pin. The substring match took 27.1-rc.1, 27.1.3 and
  27.10.2 for 27.1, so a host install would have skipped the download
  or accepted the wrong binary.
- The e2e host check accepts a two-digit year.
- release.go says how RCs are opted into: an RC installer pins RCs, and
  a final installer pins finals.

Claude-Session: https://claude.ai/code/session_01Y2F7CWRXorttf5sjSbxwpj
2026-10-28 09:55:03 -07:00

30 lines
806 B
Go

// SPDX-FileCopyrightText: 2026 Coffey Labs LLC
// SPDX-License-Identifier: AGPL-3.0-or-later
package apply
import "testing"
// A binary is the pinned release only when its version is exactly the pin.
// A substring match took 27.1-rc.1 and 27.10.2 for 27.1.
func TestIsVersion(t *testing.T) {
for _, c := range []struct {
out, want string
is bool
}{
{"2026.10.15", "2026.10.15", true},
{"27.1\n", "27.1", true},
{"27.1-rc.1", "27.1-rc.1", true},
{"27.1-rc.1", "27.1", false},
{"27.10.2", "27.1", false},
{"27.1.3", "27.1", false},
{"2026.10.15", "2026.10.1", false},
{"", "27.1", false},
{"exec format error: 27.1", "27.1", false},
} {
if got := isVersion(c.out, c.want); got != c.is {
t.Errorf("isVersion(%q, %q) = %v, want %v", c.out, c.want, got, c.is)
}
}
}