[tabs] get PutcTaB unit test working #1233

pull/2623/head
nick black 2 years ago committed by nick black
parent 7c8cf1e6e8
commit 21f68bf57c

@ -1894,7 +1894,7 @@ ncplane_put(ncplane* n, int y, int x, const char* egc, int cols,
// FIXME might need autogrow to the next tab stop out
}
}
if(cell_load_direct(n, targ, egc, bytes, cols) < 0){
if(cell_load_direct(n, targ, " ", bytes, cols) < 0){
return -1;
}
cols = (n->x + TABSTOP) / TABSTOP * TABSTOP;

@ -21,11 +21,15 @@ TEST_CASE("TaBs") { // refreshing and delicious
ncplane_cursor_yx(n, &y, &x);
CHECK(y == 0);
CHECK(x == TABWIDTH);
for(unsigned i = 0 ; i < x ; ++i){
char* c = ncplane_at_yx(n, 0, i, nullptr, nullptr);
REQUIRE(c);
CHECK(0 == strcmp(c, " "));
free(c);
char* c = ncplane_at_yx(n, 0, 0, nullptr, nullptr);
REQUIRE(c);
CHECK(0 == strcmp(c, " "));
free(c);
for(unsigned i = 1 ; i < x ; ++i){
nccell nc;
CHECK(1 == ncplane_at_yx_cell(n, 0, i, &nc));
CHECK(nccell_wide_right_p(&nc));
nccell_release(n, &nc);
}
}

Loading…
Cancel
Save