MCPcopy Create free account
hub / github.com/cogentcore/core / TestDefaults

Function TestDefaults

cli/cli_test.go:175–191  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

173}
174
175func TestDefaults(t *testing.T) {
176 cfg := &TestConfig{}
177 SetFromDefaults(cfg)
178 if cfg.Epochs != 100 || cfg.EpochLog != true || cfg.Note != "testing is fun" {
179 t.Errorf("Main defaults failed to set")
180 }
181 if cfg.PatParams.NPats != 10 || cfg.PatParams.Sparseness != 0.15 {
182 t.Errorf("PatParams defaults failed to set")
183 }
184 // fmt.Printf("%#v\n", cfg.Slice)
185 if len(cfg.Slice) != 3 || cfg.Slice[2] != 3.14 {
186 t.Errorf("Slice defaults failed to set")
187 }
188 if len(cfg.StrSlice) != 3 || cfg.StrSlice[1] != "dog one" {
189 t.Errorf("StrSlice defaults failed to set")
190 }
191}
192
193func TestGetArgs(t *testing.T) {
194 sargs := []string{"-gui", "run", "-param-set", "std", "-no-net-data", "main", "-epochs=5", "-note", "hello", "-debug=0", "-enum", "TestValue1", "-sparseness", "5.0", "-pat-params-n-pats", "28"}

Callers

nothing calls this directly

Calls 2

SetFromDefaultsFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected