Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libcurses/tests libcurses: ensure that '\b' in han...



details:   https://anonhg.NetBSD.org/src/rev/0a5edfaba662
branches:  trunk
changeset: 981007:0a5edfaba662
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Feb 25 00:26:57 2021 +0000

description:
libcurses: ensure that '\b' in handled correctly in addstr

Just to ensure that the recent fix for '\t' handling in addstr/addch
didn't introduce another bug.

diffstat:

 tests/lib/libcurses/tests/addbytes |  20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r 72ad99a90850 -r 0a5edfaba662 tests/lib/libcurses/tests/addbytes
--- a/tests/lib/libcurses/tests/addbytes        Thu Feb 25 00:25:31 2021 +0000
+++ b/tests/lib/libcurses/tests/addbytes        Thu Feb 25 00:26:57 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: addbytes,v 1.2 2021/02/13 22:19:47 rillig Exp $
+# $NetBSD: addbytes,v 1.3 2021/02/25 00:26:57 rillig Exp $
 #
 # Tests adding bytes to stdscr.
 #
@@ -18,3 +18,21 @@
 
 call OK addbytes "\n" 1
 call2 1 0 getyx STDSCR
+
+call OK addbytes "12345\010" 6
+call2 1 4 getyx STDSCR
+
+call OK addbytes "\010\010\010\010" 4
+call2 1 0 getyx STDSCR
+
+# When curx is already 0, backspace is a no-op.
+call OK addbytes "\010" 1
+call2 1 0 getyx STDSCR
+
+call OK addbytes "123\t" 4
+call2 1 8 getyx STDSCR
+
+# Backspace affects the cursor position, no matter whether the previously
+# output char was a tab or a space.
+call OK addbytes "\010" 1
+call2 1 7 getyx STDSCR



Home | Main Index | Thread Index | Old Index