Skip to content

Commit 587ae18

Browse files
committed
test: Add additional test cases
1 parent d30f0a9 commit 587ae18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

builtin/tests/builtin.py

+8
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@
2020
assert any([]) == False
2121

2222
doc="ascii"
23+
class B():
24+
def __repr__(self):
25+
return "repr method"
26+
2327
assert ascii('hello world') == "'hello world'"
2428
assert ascii('안녕 세상') == "'\\uc548\\ub155 \\uc138\\uc0c1'"
29+
assert ascii('\\') == "'\\\\'"
30+
assert ascii('\t\r\n') == "'\\t\\r\\n'"
31+
assert ascii("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F") == "'\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f'"
32+
assert ascii(B()) == 'repr method'
2533

2634
doc="chr"
2735
assert chr(65) == "A"

0 commit comments

Comments
 (0)