MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / TestConfigHasher_NonEmptyChanges

Function TestConfigHasher_NonEmptyChanges

internal/nodeagent/dispatch_test.go:309–323  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

307}
308
309func TestConfigHasher_NonEmptyChanges(t *testing.T) {
310 t.Parallel()
311 api := newTestAPI()
312 hasher := ConfigHasher(api)
313 if got := hasher(); got != "" {
314 t.Fatalf("empty manager hash = %q want empty", got)
315 }
316 // 注入一个非空配置:xray 启动时会缓存 SavedConfig;stubManager.Start 直接保存。
317 if _, err := api.DoStart(`{"inbounds":[{"tag":"v","settings":{"clients":[{"email":"x","id":"u1"}]}}]}`, ""); err != nil {
318 t.Fatalf("set config: %v", err)
319 }
320 if got := hasher(); got == "" {
321 t.Fatalf("non-empty config should hash to non-empty")
322 }
323}
324

Callers

nothing calls this directly

Calls 3

newTestAPIFunction · 0.85
ConfigHasherFunction · 0.85
DoStartMethod · 0.80

Tested by

no test coverage detected