Files
runny 746ecfaa34
deploy-hxtesting / build-and-deploy (push) Successful in 1m52s
fix: 修复 .gitignore 未锚定目录规则误伤源码(幽灵bug)
- artifacts/ 等未锚定规则会命中任意层级同名目录,导致
  frontend/src/views/artifacts/ArtifactLibrary.vue(路由动态导入)、
  cli/internal/build/(cli 模块源码)、cmd/desktop/build/(桌面构建资产)
  从未入库——本机正常、他人克隆后构建必挂
- 修复: 锚定仓库根 /artifacts/ /dist/ /build/ /tmp/ /temp/ /logs/;补 frontend/dist/
- 找回 6 个被吞文件;顺带清理改名产生的重复规则行
2026-11-14 17:49:28 +08:00

26 lines
604 B
Go

package build
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestInfo_DefaultDevValues(t *testing.T) {
v, c, d := Info()
// In a non-ldflags-injected build, these are the package defaults; tests
// that vary them need to assign at run time, not via -ldflags (testing
// here only that Info returns whatever is current).
assert.NotEmpty(t, v)
assert.NotEmpty(t, c)
assert.NotEmpty(t, d)
}
func TestInfo_ReflectsInjectedValues(t *testing.T) {
old := Version
t.Cleanup(func() { Version = old })
Version = "v0.0.0-test"
v, _, _ := Info()
assert.Equal(t, "v0.0.0-test", v)
}