summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_curses.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index c767e93..8caf0de 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -264,6 +264,20 @@ def test_issue6243(stdscr):
curses.ungetch(1025)
stdscr.getkey()
+def test_unget_wch(stdscr):
+ ch = '\xe9'
+ curses.unget_wch(ch)
+ read = stdscr.get_wch()
+ read = chr(read)
+ if read != ch:
+ raise AssertionError("%r != %r" % (read, ch))
+
+ ch = ord('\xe9')
+ curses.unget_wch(ch)
+ read = stdscr.get_wch()
+ if read != ch:
+ raise AssertionError("%r != %r" % (read, ch))
+
def main(stdscr):
curses.savetty()
try:
@@ -272,6 +286,7 @@ def main(stdscr):
test_userptr_without_set(stdscr)
test_resize_term(stdscr)
test_issue6243(stdscr)
+ test_unget_wch(stdscr)
finally:
curses.resetty()