mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
add LayoutTransPlanarWide unit test #815
This commit is contained in:
parent
357cba3843
commit
b9ad7b9bd5
@ -118,6 +118,23 @@ TEST_CASE("TextLayout") {
|
||||
ncplane_destroy(sp);
|
||||
}
|
||||
|
||||
// a long word (one requiring a split no matter what) ought not force the
|
||||
// next line, but instead be printed where it starts
|
||||
SUBCASE("LayoutTransPlanarWide") {
|
||||
auto sp = ncplane_new(nc_, 2, 8, 0, 0, nullptr);
|
||||
REQUIRE(sp);
|
||||
size_t bytes;
|
||||
const char boundstr[] = "1 我能吞下玻璃";
|
||||
CHECK(0 < ncplane_puttext(sp, 0, NCALIGN_CENTER, boundstr, &bytes));
|
||||
CHECK(0 == notcurses_render(nc_));
|
||||
CHECK(bytes == strlen(boundstr));
|
||||
char* line = ncplane_contents(sp, 0, 0, -1, -1);
|
||||
REQUIRE(line);
|
||||
CHECK(0 == strcmp(line, "1 我能吞下玻璃"));
|
||||
free(line);
|
||||
ncplane_destroy(sp);
|
||||
}
|
||||
|
||||
SUBCASE("LayoutLeadingSpaces") {
|
||||
auto sp = ncplane_new(nc_, 3, 10, 0, 0, nullptr);
|
||||
REQUIRE(sp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user