Lines Matching refs:binop_test
79 def binop_test(self, a, b, res, expr="a+b", meth="__add__"):
174 self.binop_test([1], [2], [1,2], "a+b", "__add__")
175 self.binop_test([1,2,3], 2, 1, "b in a", "__contains__")
176 self.binop_test([1,2,3], 4, 0, "b in a", "__contains__")
177 self.binop_test([1,2,3], 1, 2, "a[b]", "__getitem__")
182 self.binop_test([1,2], 3, [1,2,1,2,1,2], "a*b", "__mul__")
183 self.binop_test([1,2], 3, [1,2,1,2,1,2], "b*a", "__rmul__")
191 self.binop_test({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__")
193 self.binop_test({1:2}, {2:1}, True, "a < b", "__lt__")
194 self.binop_test({1:2,3:4}, 1, 1, "b in a", "__contains__")
195 self.binop_test({1:2,3:4}, 2, 0, "b in a", "__contains__")
196 self.binop_test({1:2,3:4}, 1, 2, "a[b]", "__getitem__")
230 self.binop_test(a, b, res, expr, name)
315 self.binop_test(spamlist([1]), spamlist([2]), spamlist([1,2]), "a+b",
317 self.binop_test(spamlist([1,2,3]), 2, 1, "b in a", "__contains__")
318 self.binop_test(spamlist([1,2,3]), 4, 0, "b in a", "__contains__")
319 self.binop_test(spamlist([1,2,3]), 1, 2, "a[b]", "__getitem__")
327 self.binop_test(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "a*b",
329 self.binop_test(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "b*a",
360 self.binop_test(spamdict({1:2}), spamdict({2:1}), -1, "cmp(a,b)",
362 self.binop_test(spamdict({1:2,3:4}), 1, 1, "b in a", "__contains__")
363 self.binop_test(spamdict({1:2,3:4}), 2, 0, "b in a", "__contains__")
364 self.binop_test(spamdict({1:2,3:4}), 1, 2, "a[b]", "__getitem__")