|
|
@ -95,7 +95,7 @@ TEST_CASE("Wide") {
|
|
|
|
wchar_t w;
|
|
|
|
wchar_t w;
|
|
|
|
CHECK(0 < mbtowc(&w, cell_extended_gcluster(n_, &tcell), MB_CUR_MAX));
|
|
|
|
CHECK(0 < mbtowc(&w, cell_extended_gcluster(n_, &tcell), MB_CUR_MAX));
|
|
|
|
if(wcwidth(w) == 2){
|
|
|
|
if(wcwidth(w) == 2){
|
|
|
|
CHECK(CELL_WIDEASIAN_MASK == testcell.channels);
|
|
|
|
CHECK(1 == testcell.width);
|
|
|
|
++x;
|
|
|
|
++x;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
CHECK(0 == testcell.channels);
|
|
|
|
CHECK(0 == testcell.channels);
|
|
|
@ -460,43 +460,34 @@ TEST_CASE("Wide") {
|
|
|
|
uint16_t stylemask;
|
|
|
|
uint16_t stylemask;
|
|
|
|
uint64_t channels;
|
|
|
|
uint64_t channels;
|
|
|
|
char* egc;
|
|
|
|
char* egc;
|
|
|
|
uint64_t widechans = ncplane_channels(n_) | CELL_WIDEASIAN_MASK;
|
|
|
|
|
|
|
|
uint64_t narchans = ncplane_channels(topp);
|
|
|
|
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(widechans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(widechans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "a"));
|
|
|
|
CHECK(0 == strcmp(egc, "a"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "b"));
|
|
|
|
CHECK(0 == strcmp(egc, "b"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "c"));
|
|
|
|
CHECK(0 == strcmp(egc, "c"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "d"));
|
|
|
|
CHECK(0 == strcmp(egc, "d"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
CHECK(0 == ncplane_move_yx(topp, 0, 3));
|
|
|
|
CHECK(0 == ncplane_move_yx(topp, 0, 3));
|
|
|
|
CHECK(0 == notcurses_render(nc_));
|
|
|
|
CHECK(0 == notcurses_render(nc_));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(widechans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
@ -506,19 +497,15 @@ TEST_CASE("Wide") {
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "a"));
|
|
|
|
CHECK(0 == strcmp(egc, "a"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "b"));
|
|
|
|
CHECK(0 == strcmp(egc, "b"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "c"));
|
|
|
|
CHECK(0 == strcmp(egc, "c"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "d"));
|
|
|
|
CHECK(0 == strcmp(egc, "d"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
@ -527,30 +514,24 @@ TEST_CASE("Wide") {
|
|
|
|
CHECK(0 == notcurses_render(nc_));
|
|
|
|
CHECK(0 == notcurses_render(nc_));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(widechans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "a"));
|
|
|
|
CHECK(0 == strcmp(egc, "a"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "b"));
|
|
|
|
CHECK(0 == strcmp(egc, "b"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "c"));
|
|
|
|
CHECK(0 == strcmp(egc, "c"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "d"));
|
|
|
|
CHECK(0 == strcmp(egc, "d"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(widechans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
@ -562,26 +543,21 @@ TEST_CASE("Wide") {
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "a"));
|
|
|
|
CHECK(0 == strcmp(egc, "a"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "b"));
|
|
|
|
CHECK(0 == strcmp(egc, "b"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "c"));
|
|
|
|
CHECK(0 == strcmp(egc, "c"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "d"));
|
|
|
|
CHECK(0 == strcmp(egc, "d"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(widechans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
@ -590,30 +566,24 @@ TEST_CASE("Wide") {
|
|
|
|
CHECK(0 == notcurses_render(nc_));
|
|
|
|
CHECK(0 == notcurses_render(nc_));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 0, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "a"));
|
|
|
|
CHECK(0 == strcmp(egc, "a"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 1, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "b"));
|
|
|
|
CHECK(0 == strcmp(egc, "b"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 2, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "c"));
|
|
|
|
CHECK(0 == strcmp(egc, "c"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 3, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "d"));
|
|
|
|
CHECK(0 == strcmp(egc, "d"));
|
|
|
|
CHECK(narchans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 4, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(widechans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 5, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 6, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(0 == strcmp(egc, "六"));
|
|
|
|
CHECK(widechans == channels);
|
|
|
|
|
|
|
|
free(egc);
|
|
|
|
free(egc);
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &stylemask, &channels)));
|
|
|
|
REQUIRE((egc = notcurses_at_yx(nc_, 0, 7, &stylemask, &channels)));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|
CHECK(0 == strcmp(egc, ""));
|
|
|
|