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

Function TestOpen

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

Source from the content-addressed store, hash-verified

297}
298
299func TestOpen(t *testing.T) {
300 opts := DefaultOptions("Test")
301 opts.IncludePaths = []string{".", "testdata"}
302 cfg := &TestConfig{}
303 err := openWithIncludes(opts, cfg, "testcfg.toml")
304 if err != nil {
305 t.Errorf(err.Error())
306 }
307
308 // fmt.Println("includes:", cfg.Includes)
309
310 // if cfg.Network != nil {
311 // mv := cfg.Network
312 // for k, v := range mv {
313 // fmt.Println(k, " = ", v)
314 // }
315 // }
316
317 if cfg.GUI != true || cfg.Tag != "testing" {
318 t.Errorf("testinc.toml not parsed\n")
319 }
320 if cfg.Epochs != 500 || cfg.GPU != true {
321 t.Errorf("testinc2.toml not parsed\n")
322 }
323 if cfg.Note != "something else" {
324 t.Errorf("testinc3.toml not parsed\n")
325 }
326 if cfg.Runs != 8 {
327 t.Errorf("testinc3.toml didn't overwrite testinc2\n")
328 }
329 if cfg.NTrials != 32 {
330 t.Errorf("testinc.toml didn't overwrite testinc2\n")
331 }
332 if cfg.NData != 12 {
333 t.Errorf("testcfg.toml didn't overwrite testinc3\n")
334 }
335 if cfg.Enum != testdata.TestValue2 {
336 t.Errorf("testinc.toml Enum value not parsed\n")
337 }
338}
339
340func TestUsage(t *testing.T) {
341 t.Skip("prints usage string")

Callers

nothing calls this directly

Calls 4

DefaultOptionsFunction · 0.85
openWithIncludesFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected