From cb17c3035bbd80bd8ea6718bae4c57cfb2555653 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Thu, 15 Jun 2017 23:20:00 +0200 Subject: Initial monitor GUI Basic monitor functionality, GTK-3.0 and QT5 backends --- test/test-htmlattrtext.cc | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/test-htmlattrtext.cc (limited to 'test/test-htmlattrtext.cc') diff --git a/test/test-htmlattrtext.cc b/test/test-htmlattrtext.cc new file mode 100644 index 0000000..a0d18e6 --- /dev/null +++ b/test/test-htmlattrtext.cc @@ -0,0 +1,38 @@ +// -*- mode: c++; c-basic-offset: 2; -*- + +#include "common.hh" +#include "test.hh" + +#include + +#include "gui_htmlattrtext.hh" + +namespace { + +bool test_sanity() { + std::unique_ptr attr(HtmlAttributedText::create()); + HtmlAttributedText::Attribute red(0xff, 0, 0); + HtmlAttributedText::Attribute bold; + HtmlAttributedText::Attribute green(0, 0xff, 0); + bold.set_bold(true); + ASSERT_EQ("", attr->html()); + attr->append("Hello World"); + ASSERT_EQ("Hello World", attr->html()); + attr->append(" ", red); + ASSERT_EQ("Hello World <!>", attr->html()); + attr->add(bold, 0, 5); + ASSERT_EQ("Hello World <!>", attr->html()); + attr->add(red, 1, 2); + ASSERT_EQ("Hello World <!>", attr->html()); + attr->set(green, 1, 1); + ASSERT_EQ("Hello World <!>", attr->html()); + return true; +} + +} // namespace + +int main(void) { + BEFORE; + RUN(test_sanity()); + AFTER; +} -- cgit v1.2.3-70-g09d2