MCPcopy Index your code
hub / github.com/google/mangle / TestEqualsNegative

Function TestEqualsNegative

ast/ast_test.go:186–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

184}
185
186func 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
214func TestHash(t *testing.T) {
215 tests := []struct {

Callers

nothing calls this directly

Calls 4

StringFunction · 0.85
NewAtomFunction · 0.85
nameFunction · 0.70
EqualsMethod · 0.65

Tested by

no test coverage detected