()
| 24 | |
| 25 | |
| 26 | def test_encode_metastring_lower_special(): |
| 27 | encoder = MetaStringEncoder(special_char1=".", special_char2="_") |
| 28 | decoder = MetaStringDecoder(special_char1=".", special_char2="_") |
| 29 | |
| 30 | # Test for encoding and decoding |
| 31 | encoded = encoder._encode_lower_special("abc_def") |
| 32 | assert len(encoded) == 5 |
| 33 | assert len(encoder.encode("org.apache.fory.benchmark.data").encoded_data) == 19 |
| 34 | assert len(encoder.encode("MediaContent").encoded_data) == 9 |
| 35 | decoded = decoder.decode(encoded, Encoding.LOWER_SPECIAL) |
| 36 | assert decoded == "abc_def" |
| 37 | |
| 38 | for i in range(128): |
| 39 | builder = "".join(chr(ord("a") + j % 26) for j in range(i)) |
| 40 | encoded = encoder._encode_lower_special(builder) |
| 41 | decoded = decoder.decode(encoded, Encoding.LOWER_SPECIAL) |
| 42 | assert decoded == builder |
| 43 | |
| 44 | |
| 45 | def test_encode_metastring_lower_upper_digit_special(): |
nothing calls this directly
no test coverage detected