(t *testing.T)
| 972 | } |
| 973 | |
| 974 | func TestPatternFixRepeatingArguments(t *testing.T) { |
| 975 | p := newOption("-a", "", 0, false) |
| 976 | p.fixRepeatingArguments() |
| 977 | if p.eq(newOption("-a", "", 0, false)) != true { |
| 978 | t.Fail() |
| 979 | } |
| 980 | |
| 981 | p = newArgument("N", nil) |
| 982 | p.fixRepeatingArguments() |
| 983 | if p.eq(newArgument("N", nil)) != true { |
| 984 | t.Fail() |
| 985 | } |
| 986 | |
| 987 | p = newRequired( |
| 988 | newArgument("N", nil), |
| 989 | newArgument("N", nil)) |
| 990 | q := newRequired( |
| 991 | newArgument("N", []string{}), |
| 992 | newArgument("N", []string{})) |
| 993 | p.fixRepeatingArguments() |
| 994 | if p.eq(q) != true { |
| 995 | t.Fail() |
| 996 | } |
| 997 | |
| 998 | p = newEither( |
| 999 | newArgument("N", nil), |
| 1000 | newOneOrMore(newArgument("N", nil))) |
| 1001 | q = newEither( |
| 1002 | newArgument("N", []string{}), |
| 1003 | newOneOrMore(newArgument("N", []string{}))) |
| 1004 | p.fix() |
| 1005 | if p.eq(q) != true { |
| 1006 | t.Fail() |
| 1007 | } |
| 1008 | } |
| 1009 | |
| 1010 | func TestSet(t *testing.T) { |
| 1011 | p := newArgument("N", nil) |
nothing calls this directly
no test coverage detected