MCPcopy Create free account
hub / github.com/SamNet-dev/snix / TestDefaults

Function TestDefaults

config/config_test.go:152–177  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

150}
151
152func TestDefaults(t *testing.T) {
153 y := `
154version: 1
155profiles:
156 - name: only
157 listen: "127.0.0.1:9"
158 connect: {host: x.io}
159 spoof: {strategy: wrong_seq, sni: a.io}`
160 c, err := Parse([]byte(y))
161 if err != nil {
162 t.Fatal(err)
163 }
164 p := &c.Profiles[0]
165 if p.Connect.Port != 443 {
166 t.Errorf("default port: got %d want 443", p.Connect.Port)
167 }
168 if p.Health.Interval == 0 {
169 t.Error("default Health.Interval not set")
170 }
171 if c.Log.Level != "info" {
172 t.Errorf("default log level: got %q", c.Log.Level)
173 }
174 if c.Active != "only" {
175 t.Errorf("default active: got %q", c.Active)
176 }
177}

Callers

nothing calls this directly

Calls 1

ParseFunction · 0.85

Tested by

no test coverage detected