diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-06-10 16:02:29 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-06-11 14:27:09 +0200 |
commit | 97789d374c40f4f7fc8feb19c1235ca09ad2e06e (patch) | |
tree | 38373d43cf0f5c36321fe46a1d38c7992acd3887 /src/test | |
parent | 96b733e99694e74dcd38b16112655f7e1ea2d43b (diff) |
util: Add function FormatParagraph to format paragraph to fixed-width
This is to be used for the `-version` and `-help` messages.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/util_tests.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 0e53a57593..0b071361d8 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -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() |