(self)
| 248 | ) |
| 249 | |
| 250 | def test_multiple_groups(self) -> None: |
| 251 | x0 = NameExpr("x0") |
| 252 | x1 = NameExpr("x1") |
| 253 | x2 = NameExpr("x2") |
| 254 | x3 = NameExpr("x3") |
| 255 | x4 = NameExpr("x4") |
| 256 | x5 = NameExpr("x5") |
| 257 | |
| 258 | self.assertEqual( |
| 259 | group_comparison_operands( |
| 260 | [("==", x0, x1), ("==", x1, x2), ("is", x2, x3), ("is", x3, x4)], |
| 261 | self.literal_keymap({}), |
| 262 | {"==", "is"}, |
| 263 | ), |
| 264 | [("==", [0, 1, 2]), ("is", [2, 3, 4])], |
| 265 | ) |
| 266 | self.assertEqual( |
| 267 | group_comparison_operands( |
| 268 | [("==", x0, x1), ("==", x1, x2), ("==", x2, x3), ("==", x3, x4)], |
| 269 | self.literal_keymap({}), |
| 270 | {"==", "is"}, |
| 271 | ), |
| 272 | [("==", [0, 1, 2, 3, 4])], |
| 273 | ) |
| 274 | self.assertEqual( |
| 275 | group_comparison_operands( |
| 276 | [("is", x0, x1), ("==", x1, x2), ("==", x2, x3), ("==", x3, x4)], |
| 277 | self.literal_keymap({}), |
| 278 | {"==", "is"}, |
| 279 | ), |
| 280 | [("is", [0, 1]), ("==", [1, 2, 3, 4])], |
| 281 | ) |
| 282 | self.assertEqual( |
| 283 | group_comparison_operands( |
| 284 | [("is", x0, x1), ("is", x1, x2), ("<", x2, x3), ("==", x3, x4), ("==", x4, x5)], |
| 285 | self.literal_keymap({}), |
| 286 | {"==", "is"}, |
| 287 | ), |
| 288 | [("is", [0, 1, 2]), ("<", [2, 3]), ("==", [3, 4, 5])], |
| 289 | ) |
| 290 | |
| 291 | def test_multiple_groups_coalescing(self) -> None: |
| 292 | x0 = NameExpr("x0") |
nothing calls this directly
no test coverage detected