| 184 | } |
| 185 | |
| 186 | func TestEqualsNegative(t *testing.T) { |
| 187 | tests := []struct { |
| 188 | left Term |
| 189 | right Term |
| 190 | }{ |
| 191 | {left: fooBarPair, right: fooBarList}, |
| 192 | {left: fooBarPair, right: barFooPair}, |
| 193 | {left: fooBarPair, right: fooFooPair}, |
| 194 | {left: fooBarList, right: fooBarPair}, |
| 195 | {left: fooBarList, right: barFooList}, |
| 196 | {left: fooBarList, right: fooFooList}, |
| 197 | {left: fooBarList, right: ListNil}, |
| 198 | {left: floatNumConstant, right: numConstant}, |
| 199 | {left: ListNil, right: fooBarList}, |
| 200 | {left: Variable{"X"}, right: Variable{"Y"}}, |
| 201 | {left: name("/foo"), right: name("/bar")}, |
| 202 | {left: name("/foo"), right: String("foo")}, |
| 203 | {left: NewAtom("foo", Variable{"X"}), right: NewAtom("foo", Variable{"Y"})}, |
| 204 | {left: Eq{Variable{"X"}, Variable{"Y"}}, right: Eq{Variable{"Y"}, Variable{"X"}}}, |
| 205 | {left: Ineq{Variable{"X"}, Variable{"Y"}}, right: Ineq{Variable{"Y"}, Variable{"X"}}}, |
| 206 | } |
| 207 | for _, test := range tests { |
| 208 | if test.left.Equals(test.right) { |
| 209 | t.Errorf("(%v).Equals(%v) expected false got true", test.left, test.right) |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | func TestHash(t *testing.T) { |
| 215 | tests := []struct { |