enhance SetStyles unit test

This commit is contained in:
nick black 2019-11-29 05:37:41 -05:00 committed by Nick Black
parent 5e35e05151
commit 9fe6c152a9
2 changed files with 14 additions and 3 deletions

View File

@ -834,13 +834,13 @@ term_putc(FILE* out, const ncplane* n, const cell* c){
static void
advance_cursor(ncplane* n, int cols){
if(n->y == n->leny){
if(n->x == n->lenx){
if(n->y >= n->leny){
if(n->x >= n->lenx){
return; // stuck!
}
}
if((n->x += cols) >= n->lenx){
if(n->y == n->leny){
if(n->y >= n->leny){
n->x = n->lenx;
}else{
n->x -= n->lenx;

View File

@ -50,6 +50,17 @@ TEST_F(CellTest, SetStyles) {
}
}
EXPECT_EQ(0, notcurses_render(nc_));
cell_styles_off(&c, CELL_STYLE_ITALIC);
for(y = 0 ; y < dimy ; ++y){
ncplane_cursor_move_yx(n_, y, 0);
for(x = 0 ; x < dimx ; ++x){
EXPECT_EQ(1, ncplane_putc(n_, &c));
}
}
ncplane_cursor_yx(n_, &y, &x);
EXPECT_EQ(dimy, y);
EXPECT_EQ(0, x); // FIXME shouldn't this be dimx?!?!
EXPECT_EQ(0, notcurses_render(nc_));
}
/*TEST_F(CellTest, CellLoadTamil) {