| 191 | } |
| 192 | |
| 193 | func 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 | |
| 210 | func TestArgsPrint(t *testing.T) { |
| 211 | t.Skip("prints all possible args") |