mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-20 03:25:47 +00: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);
|
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") {
|
SUBCASE("LayoutLeadingSpaces") {
|
||||||
auto sp = ncplane_new(nc_, 3, 10, 0, 0, nullptr);
|
auto sp = ncplane_new(nc_, 3, 10, 0, 0, nullptr);
|
||||||
REQUIRE(sp);
|
REQUIRE(sp);
|
||||||
|
Loading…
Reference in New Issue
Block a user