(t *testing.T)
| 1040 | } |
| 1041 | |
| 1042 | func TestPatternFixIdentities2(t *testing.T) { |
| 1043 | p := newRequired( |
| 1044 | newOptional( |
| 1045 | newArgument("X", nil), |
| 1046 | newArgument("N", nil)), |
| 1047 | newArgument("N", nil)) |
| 1048 | if len(p.children) < 2 { |
| 1049 | t.FailNow() |
| 1050 | } |
| 1051 | if len(p.children[0].children) < 2 { |
| 1052 | t.FailNow() |
| 1053 | } |
| 1054 | if p.children[0].children[1].eq(p.children[1]) != true { |
| 1055 | t.Fail() |
| 1056 | } |
| 1057 | if p.children[0].children[1] == p.children[1] { |
| 1058 | t.Fail() |
| 1059 | } |
| 1060 | p.fixIdentities(nil) |
| 1061 | if p.children[0].children[1] != p.children[1] { |
| 1062 | t.Fail() |
| 1063 | } |
| 1064 | } |
| 1065 | |
| 1066 | func TestLongOptionsErrorHandling(t *testing.T) { |
| 1067 | _, err := Parse("Usage: prog", []string{"--non-existent"}, true, "", false, false) |
nothing calls this directly
no test coverage detected