summaryrefslogtreecommitdiffstats
path: root/src/base/attr_line.tests.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-07 04:48:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-07 04:48:35 +0000
commit207df6fc406e81bfeebdff7f404bd242ff3f099f (patch)
treea1a796b056909dd0a04ffec163db9363a8757808 /src/base/attr_line.tests.cc
parentReleasing progress-linux version 0.11.2-1~progress7.99u1. (diff)
downloadlnav-207df6fc406e81bfeebdff7f404bd242ff3f099f.tar.xz
lnav-207df6fc406e81bfeebdff7f404bd242ff3f099f.zip
Merging upstream version 0.12.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/base/attr_line.tests.cc')
-rw-r--r--src/base/attr_line.tests.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/base/attr_line.tests.cc b/src/base/attr_line.tests.cc
index 53b338e..8e23480 100644
--- a/src/base/attr_line.tests.cc
+++ b/src/base/attr_line.tests.cc
@@ -36,6 +36,15 @@
using namespace lnav::roles::literals;
+TEST_CASE("line_range")
+{
+ line_range lr1{0, 95};
+ line_range lr2{0, -1};
+
+ CHECK(lr2 < lr1);
+ CHECK(!(lr1 < lr2));
+}
+
TEST_CASE("attr_line_t::basic-wrapping")
{
text_wrap_settings tws = {3, 21};
@@ -89,3 +98,18 @@ TEST_CASE("attr_line_t::unicode-wrap")
" be wrapped and\n"
" indented");
}
+
+TEST_CASE("attr_line_t::pre-wrap")
+{
+ auto pre_al = attr_line_t(" Hello, World! ")
+ .with_attr_for_all(SA_PREFORMATTED.value());
+ auto al = attr_line_t("This is a pre-formatted inline -- ")
+ .append(pre_al)
+ .append(" -- that should be wrapped");
+
+ text_wrap_settings tws = {0, 36};
+
+ auto body = attr_line_t().append(al, &tws);
+
+ printf("body\n%s\n", body.get_string().c_str());
+}