mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
util: Add function FormatParagraph to format paragraph to fixed-width
This is to be used for the `-version` and `-help` messages.
This commit is contained in:
parent
96b733e996
commit
97789d374c
3 changed files with 51 additions and 0 deletions
|
|
@ -351,4 +351,15 @@ BOOST_AUTO_TEST_CASE(test_ParseInt32)
|
|||
BOOST_CHECK(!ParseInt32("32482348723847471234", NULL));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_FormatParagraph)
|
||||
{
|
||||
BOOST_CHECK_EQUAL(FormatParagraph("", 79, 0), "");
|
||||
BOOST_CHECK_EQUAL(FormatParagraph("test", 79, 0), "test");
|
||||
BOOST_CHECK_EQUAL(FormatParagraph(" test", 79, 0), "test");
|
||||
BOOST_CHECK_EQUAL(FormatParagraph("test test", 79, 0), "test test");
|
||||
BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 0), "test\ntest");
|
||||
BOOST_CHECK_EQUAL(FormatParagraph("testerde test ", 4, 0), "testerde\ntest");
|
||||
BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 4), "test\n test");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue