[tabs] update plane+cell unit tests #1233

This commit is contained in:
nick black 2022-02-11 05:24:25 -05:00 committed by nick black
parent 78cc44a1bf
commit 3681a95b3c
2 changed files with 6 additions and 3 deletions

View File

@ -359,7 +359,7 @@ TEST_CASE("Cell") {
nccell c = NCCELL_TRIVIAL_INITIALIZER;
CHECK(-1 == nccell_load_char(n_, &c, '\f'));
CHECK(-1 == nccell_load_char(n_, &c, '\v'));
CHECK(-1 == nccell_load_char(n_, &c, '\t'));
CHECK(1 == nccell_load_char(n_, &c, '\t'));
CHECK(1 == nccell_load_char(n_, &c, '\n'));
CHECK(1 == nccell_load_char(n_, &c, ' '));
}

View File

@ -1031,14 +1031,17 @@ TEST_CASE("Plane") {
ncplane_destroy(n1);
}
// you ought not be able to output control characters
// you ought not be able to output control characters, aside from tab, and
// newlines (when we're scrolling).
SUBCASE("DenyControlASCII") {
signed char c = 0;
c = -1;
do{
++c;
if(c && !isprint(c)){
if(c != '\t'){
CHECK(0 > ncplane_putchar_yx(n_, 0, 0, c));
}
}else{
CHECK(1 == ncplane_putchar_yx(n_, 0, 0, c));
}