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

Function TestGetArgs

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

Source from the content-addressed store, hash-verified

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"}
195 bf := boolFlags(&TestConfig{})
196 args, flags, err := getArgs(sargs, bf)
197 if err != nil {
198 t.Errorf("error getting args: %v", err)
199 }
200 wargs := []string{"run", "main"}
201 if !reflect.DeepEqual(args, wargs) {
202 t.Errorf("expected args to be \n%#v\n\tbut got \n%#v", wargs, args)
203 }
204 wflags := map[string]string{"debug": "0", "enum": "TestValue1", "epochs": "5", "gui": "", "no-net-data": "", "note": "hello", "param-set": "std", "pat-params-n-pats": "28", "sparseness": "5.0"}
205 if !reflect.DeepEqual(flags, wflags) {
206 t.Errorf("expected flags to be \n%#v\n\tbut got \n%#v", wflags, flags)
207 }
208}
209
210func TestArgsPrint(t *testing.T) {
211 t.Skip("prints all possible args")

Callers

nothing calls this directly

Calls 3

boolFlagsFunction · 0.85
getArgsFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected