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

Function TestConfigOpen

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

Source from the content-addressed store, hash-verified

354}
355
356func TestConfigOpen(t *testing.T) {
357 // t.Skip("prints usage string")
358 opts := DefaultOptions("Test")
359 opts.IncludePaths = []string{".", "testdata"}
360 opts.NeedConfigFile = true
361 cfg := &TestConfig{}
362 _, err := config(opts, cfg)
363 if err == nil {
364 t.Errorf("should have Config error")
365 // } else {
366 // fmt.Println(err)
367 }
368 opts.DefaultFiles = []string{"aldfkj.toml"}
369 _, err = config(opts, cfg)
370 if err == nil {
371 t.Errorf("should have Config error")
372 // } else {
373 // fmt.Println(err)
374 }
375 opts.DefaultFiles = []string{"aldfkj.toml", "testcfg.toml"}
376 _, err = config(opts, cfg)
377 if err != nil {
378 t.Error(err)
379 }
380}

Callers

nothing calls this directly

Calls 4

DefaultOptionsFunction · 0.85
configFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected