mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2026-12-01 17:02:33 +00:00
- 仅在 full flavor 注册 -l/--dns 独占终端模式 - 锁定 q v0.19.12 并加入差分、fatal 与 flavor 隔离门禁 - 记录架构、体积、许可证、升级协议与已知风险
37 lines
860 B
Go
37 lines
860 B
Go
//go:build !flavor_tiny && !flavor_ntr
|
|
|
|
package dnsclient
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"golang.org/x/mod/modfile"
|
|
)
|
|
|
|
func TestQDependencyIsExactlyPinnedWithoutReplace(t *testing.T) {
|
|
data, err := os.ReadFile("../../go.mod")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
module, err := modfile.Parse("go.mod", data, nil)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for _, dependency := range module.Require {
|
|
if dependency.Mod.Path != "github.com/natesales/q" {
|
|
continue
|
|
}
|
|
if dependency.Mod.Version != qCompatibilityVersion {
|
|
t.Fatalf("q version = %s, want %s", dependency.Mod.Version, qCompatibilityVersion)
|
|
}
|
|
for _, replacement := range module.Replace {
|
|
if replacement.Old.Path == dependency.Mod.Path {
|
|
t.Fatalf("q dependency uses replace: %s => %s", replacement.Old, replacement.New)
|
|
}
|
|
}
|
|
return
|
|
}
|
|
t.Fatal("q dependency missing from go.mod")
|
|
}
|