gralculator/internal/version/version_test.go
Grok 17303d1446
Some checks failed
CI / Test (push) Successful in 16s
Release / Create Release (push) Failing after 2m1s
CI / Build (push) Has been skipped
CI / Lint (push) Failing after 26s
feat(calc,ui): complete tight-mode HEX entry with cross-base chaining and result formatting
- Add formatResultEntryForBase + update Equals/Mod/ChangeSign so committed results
  format in the active display base (e.g. HEX shows "C8", "1B0" not decimal).
- Robust per-line centering for dynamic A-F hexRow and keypad rows under display
  (prevents split key borders/decorations on bottom row).
- Updated test expectation for HEX result digits.
- Enables validated cross-base flow: DEC entry, Tab to HEX, continue op, see
  result in active base, Tab back converts displayed value correctly.
- style: gofmt -s all touched sources (ui_test.go, version_test.go etc.).
- ci: add lint and cross targets to Makefile.
  - cross produces the 6 platform binaries expected by release.yml on v* tags.
  - lint target for local parity (CI continues to use golangci-lint-action).

This is the v0.3.0 release-ready state (user-validated: 100 DEC -> Tab HEX +64 = C8 -> Tab DEC 200).
2026-06-06 17:04:11 +01:00

25 lines
435 B
Go

package version
import (
"strings"
"testing"
)
func TestString(t *testing.T) {
// default dev
if got := String(); got != "dev" {
t.Errorf("default: want dev, got %s", got)
}
// with commit
Version = "1.0.0"
Commit = "abc123"
if got := String(); !strings.Contains(got, "1.0.0") || !strings.Contains(got, "abc123") {
t.Errorf("with commit: want version-commit, got %s", got)
}
// reset
Version = "dev"
Commit = ""
}