Skip to content

Commit 28d9525

Browse files
h0tak88rclaude
andcommitted
fix(test): assert version is semver, not a hardcoded value; update dashboard screenshot
version_test.go hardcoded want "4.2.0", so the v4.3.0 bump failed CI. Assert the semver shape instead so future bumps don't break the test. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 097ee38 commit 28d9525

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

image.png

-117 KB
Loading

internal/version/version_test.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
package version
22

3-
import "testing"
3+
import (
4+
"regexp"
5+
"testing"
6+
)
7+
8+
// semverRe matches a plain semantic version (no leading "v"), optionally with a
9+
// pre-release/build suffix. Asserting the shape — not a hardcoded value — means
10+
// version bumps don't break CI.
11+
var semverRe = regexp.MustCompile(`^\d+\.\d+\.\d+([-+].+)?$`)
412

513
func TestVersion(t *testing.T) {
614
if Version == "" {
7-
t.Error("Version should not be empty")
15+
t.Fatal("Version should not be empty")
816
}
9-
if Version != "4.2.0" {
10-
t.Errorf("Version = %q, want %q", Version, "4.2.0")
17+
if !semverRe.MatchString(Version) {
18+
t.Errorf("Version = %q, want semantic version like 1.2.3", Version)
1119
}
1220
}

0 commit comments

Comments
 (0)