We already tested all corner cases for two-byte and three-byte UTF-8
authorschwarze <schwarze@openbsd.org>
Thu, 1 Jul 2021 10:00:15 +0000 (10:00 +0000)
committerschwarze <schwarze@openbsd.org>
Thu, 1 Jul 2021 10:00:15 +0000 (10:00 +0000)
sequences, but coverage of four-byte sequences was incomplete, which
contributed to the recently fixed ksh(1) emacs.c bug not being found
for some time.

Consequently, add some tests covering
+ valid sequences starting with \0360, \0361, and \0363;
+ incomplete sequences starting with \0360 and \0361;
+ invalid (too low) sequences starting with \0360.

OK anton@

regress/bin/ksh/edit/emacs.sh

index 47f050b..d1f5a41 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $OpenBSD: emacs.sh,v 1.12 2021/06/30 18:55:52 schwarze Exp $
+# $OpenBSD: emacs.sh,v 1.13 2021/07/01 10:00:15 schwarze Exp $
 #
 # Copyright (c) 2017 Anton Lindqvist <anton@openbsd.org>
 # Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -42,6 +42,10 @@ testseq "z\0002\0355\0200\0200" " # z\b\0355\0200\0200z\b"
 testseq "z\0002\0355\0237\0277" " # z\b\0355\0237\0277z\b"
 testseq "z\0002\0356\0200\0200" " # z\b\0356\0200\0200z\b"
 testseq "z\0002\0357\0277\0277" " # z\b\0357\0277\0277z\b"
+testseq "z\0002\0360\0220\0200\0200" " # z\b\0360\0220\0200\0200z\b"
+testseq "z\0002\0360\0277\0277\0277" " # z\b\0360\0277\0277\0277z\b"
+testseq "z\0002\0361\0200\0200\0200" " # z\b\0361\0200\0200\0200z\b"
+testseq "z\0002\0363\0277\0277\0277" " # z\b\0363\0277\0277\0277z\b"
 testseq "z\0002\0364\0200\0200\0200" " # z\b\0364\0200\0200\0200z\b"
 testseq "z\0002\0364\0217\0277\0277" " # z\b\0364\0217\0277\0277z\b"
 
@@ -58,6 +62,9 @@ testseq "z\0002\0355\0200\0006" " # z\b\0355\0200z\bz"
 testseq "z\0002\0355\0237\0006" " # z\b\0355\0237z\bz"
 testseq "z\0002\0356\0200\0006" " # z\b\0356\0200z\bz"
 testseq "z\0002\0357\0277\0006" " # z\b\0357\0277z\bz"
+testseq "z\0002\0360\0220\0200\0006" " # z\b\0360\0220\0200z\bz"
+testseq "z\0002\0360\0277\0277\0006" " # z\b\0360\0277\0277z\bz"
+testseq "z\0002\0361\0200\0200\0006" " # z\b\0361\0200\0200z\bz"
 testseq "z\0002\0363\0200\0200\0006" " # z\b\0363\0200\0200z\bz"
 testseq "z\0002\0363\0277\0277\0006" " # z\b\0363\0277\0277z\bz"
 testseq "z\0002\0364\0200\0200\0006" " # z\b\0364\0200\0200z\bz"
@@ -81,6 +88,10 @@ testseq "z\0002\0340\0202\0200" \
        " # z\b\0340z\b\b\0340\0202z\b\b\0340\0202\0200z\b"
 testseq "z\0002\0340\0237\0277" \
        " # z\b\0340z\b\b\0340\0237z\b\b\0340\0237\0277z\b"
+testseq "z\0002\0360\0200\0200\0200" \
+  " # z\b\0360z\b\b\0360\0200z\b\b\0360\0200\0200z\b\b\0360\0200\0200\0200z\b"
+testseq "z\0002\0360\0217\0277\0277" \
+  " # z\b\0360z\b\b\0360\0217z\b\b\0360\0217\0277z\b\b\0360\0217\0277\0277z\b"
 
 # insertion of surrogates and execessive code points
 testseq "z\0002\0355\0240\0200" \