Module Name:    src
Committed By:   rillig
Date:           Thu Feb 25 00:26:57 UTC 2021

Modified Files:
        src/tests/lib/libcurses/tests: addbytes

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/addbytes

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/tests/addbytes
diff -u src/tests/lib/libcurses/tests/addbytes:1.2 src/tests/lib/libcurses/tests/addbytes:1.3
--- src/tests/lib/libcurses/tests/addbytes:1.2	Sat Feb 13 22:19:47 2021
+++ src/tests/lib/libcurses/tests/addbytes	Thu Feb 25 00:26:57 2021
@@ -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 @@ call2 0 16 getyx STDSCR
 
 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

Reply via email to