(t *testing.T)
| 21 | ) |
| 22 | |
| 23 | func TestPatternFlat(t *testing.T) { |
| 24 | q := patternList{ |
| 25 | newArgument("N", nil), |
| 26 | newOption("-a", "", 0, false), |
| 27 | newArgument("M", nil)} |
| 28 | p, err := newRequired( |
| 29 | newOneOrMore(newArgument("N", nil)), |
| 30 | newOption("-a", "", 0, false), |
| 31 | newArgument("M", nil)).flat(patternDefault) |
| 32 | if reflect.DeepEqual(p, q) != true { |
| 33 | t.Error(err) |
| 34 | } |
| 35 | |
| 36 | q = patternList{newOptionsShortcut()} |
| 37 | p, err = newRequired( |
| 38 | newOptional(newOptionsShortcut()), |
| 39 | newOptional(newOption("-a", "", 0, false))).flat(patternOptionSSHORTCUT) |
| 40 | if reflect.DeepEqual(p, q) != true { |
| 41 | t.Error(err) |
| 42 | } |
| 43 | return |
| 44 | } |
| 45 | |
| 46 | func TestOption(t *testing.T) { |
| 47 | if !parseOption("-h").eq(newOption("-h", "", 0, false)) { |
nothing calls this directly
no test coverage detected