Lines Matching refs:binop_test
77 def binop_test(self, a, b, res, expr="a+b", meth="__add__"):
172 self.binop_test([1], [2], [1,2], "a+b", "__add__")
173 self.binop_test([1,2,3], 2, 1, "b in a", "__contains__")
174 self.binop_test([1,2,3], 4, 0, "b in a", "__contains__")
175 self.binop_test([1,2,3], 1, 2, "a[b]", "__getitem__")
180 self.binop_test([1,2], 3, [1,2,1,2,1,2], "a*b", "__mul__")
181 self.binop_test([1,2], 3, [1,2,1,2,1,2], "b*a", "__rmul__")
189 self.binop_test({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__")
191 self.binop_test({1:2}, {2:1}, True, "a < b", "__lt__")
192 self.binop_test({1:2,3:4}, 1, 1, "b in a", "__contains__")
193 self.binop_test({1:2,3:4}, 2, 0, "b in a", "__contains__")
194 self.binop_test({1:2,3:4}, 1, 2, "a[b]", "__getitem__")
228 self.binop_test(a, b, res, expr, name)
313 self.binop_test(spamlist([1]), spamlist([2]), spamlist([1,2]), "a+b",
315 self.binop_test(spamlist([1,2,3]), 2, 1, "b in a", "__contains__")
316 self.binop_test(spamlist([1,2,3]), 4, 0, "b in a", "__contains__")
317 self.binop_test(spamlist([1,2,3]), 1, 2, "a[b]", "__getitem__")
325 self.binop_test(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "a*b",
327 self.binop_test(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "b*a",
358 self.binop_test(spamdict({1:2}), spamdict({2:1}), -1, "cmp(a,b)",
360 self.binop_test(spamdict({1:2,3:4}), 1, 1, "b in a", "__contains__")
361 self.binop_test(spamdict({1:2,3:4}), 2, 0, "b in a", "__contains__")
362 self.binop_test(spamdict({1:2,3:4}), 1, 2, "a[b]", "__getitem__")