| 393 | assert result == ["foo"] |
| 394 | |
| 395 | def test_idmaker_native_strings(self) -> None: |
| 396 | result = idmaker( |
| 397 | ("a", "b"), |
| 398 | [ |
| 399 | pytest.param(1.0, -1.1), |
| 400 | pytest.param(2, -202), |
| 401 | pytest.param("three", "three hundred"), |
| 402 | pytest.param(True, False), |
| 403 | pytest.param(None, None), |
| 404 | pytest.param(re.compile("foo"), re.compile("bar")), |
| 405 | pytest.param(str, int), |
| 406 | pytest.param(list("six"), [66, 66]), |
| 407 | pytest.param({7}, set("seven")), |
| 408 | pytest.param(tuple("eight"), (8, -8, 8)), |
| 409 | pytest.param(b"\xc3\xb4", b"name"), |
| 410 | pytest.param(b"\xc3\xb4", "other"), |
| 411 | pytest.param(1.0j, -2.0j), |
| 412 | ], |
| 413 | ) |
| 414 | assert result == [ |
| 415 | "1.0--1.1", |
| 416 | "2--202", |
| 417 | "three-three hundred", |
| 418 | "True-False", |
| 419 | "None-None", |
| 420 | "foo-bar", |
| 421 | "str-int", |
| 422 | "a7-b7", |
| 423 | "a8-b8", |
| 424 | "a9-b9", |
| 425 | "\\xc3\\xb4-name", |
| 426 | "\\xc3\\xb4-other", |
| 427 | "1j-(-0-2j)", |
| 428 | ] |
| 429 | |
| 430 | def test_idmaker_non_printable_characters(self) -> None: |
| 431 | result = idmaker( |