Skip to content

Commit 050dd5b

Browse files
committed
add tests for new unicode support
1 parent e64ded3 commit 050dd5b

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

tests/windows/test_readchar.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,18 @@ def test_controlCharacters(seq, key, patched_stdin):
6262
def test_CTRL_Characters(seq, key, patched_stdin):
6363
patched_stdin.push(seq)
6464
assert key == readchar()
65+
66+
67+
@pytest.mark.parametrize(
68+
["seq", "key"],
69+
[
70+
("\xe4", "ä"),
71+
("\xe1", "á"),
72+
("\xe5", "å"),
73+
("\xdf", "ß"),
74+
("\u304c", "が"),
75+
],
76+
)
77+
def test_Unicode_Characters(seq, key, patched_stdin):
78+
patched_stdin.push(seq)
79+
assert key == readchar()

tests/windows/test_readkey.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,22 @@ def test_navigationKeys(seq, key, patched_stdin):
6565
def test_functionKeys(seq, key, patched_stdin):
6666
patched_stdin.push(seq)
6767
assert key == readkey()
68+
69+
70+
@pytest.mark.parametrize(
71+
["seq", "key"],
72+
[
73+
("\ud83d\ude00", "😀"),
74+
("\ud83d\ude18", "😘"),
75+
("\ud83d\ude09", "😉"),
76+
("\ud83d\udc4d", "👍"),
77+
("\ud83d\udc35", "🐵"),
78+
("\ud83c\udf47", "🍇"),
79+
("\ud83c\udf83", "🎃"),
80+
("\ud83d\udc53", "👓"),
81+
("\ud83c\udfc1", "🏁"),
82+
],
83+
)
84+
def test_UnicodeSurrogates(seq, key, patched_stdin):
85+
patched_stdin.push(seq)
86+
assert key == readkey()

0 commit comments

Comments
 (0)