mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
enhance SetStyles unit test
This commit is contained in:
parent
5e35e05151
commit
9fe6c152a9
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user