mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-18 02:51:06 +00:00
Merge pull request #5435
a26bf47 Add a new test for FormatParagraph (string longer than the default width). (Pavel Janík) 83b81f6 Format paragraphs properly - count the space between words. (Pavel Janík)
This commit is contained in:
commit
4d8bea0dc3
@ -340,6 +340,7 @@ BOOST_AUTO_TEST_CASE(test_FormatParagraph)
|
|||||||
BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 0), "test\ntest");
|
BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 0), "test\ntest");
|
||||||
BOOST_CHECK_EQUAL(FormatParagraph("testerde test ", 4, 0), "testerde\ntest");
|
BOOST_CHECK_EQUAL(FormatParagraph("testerde test ", 4, 0), "testerde\ntest");
|
||||||
BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 4), "test\n test");
|
BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 4), "test\n test");
|
||||||
|
BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string. This is a second sentence in the very long test string."), "This is a very long test string. This is a second sentence in the very long\ntest string.");
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(test_FormatSubVersion)
|
BOOST_AUTO_TEST_CASE(test_FormatSubVersion)
|
||||||
|
@ -459,7 +459,7 @@ std::string FormatParagraph(const std::string in, size_t width, size_t indent)
|
|||||||
}
|
}
|
||||||
// Append word
|
// Append word
|
||||||
out << in.substr(ptr, endword - ptr);
|
out << in.substr(ptr, endword - ptr);
|
||||||
col += endword - ptr;
|
col += endword - ptr + 1;
|
||||||
ptr = endword;
|
ptr = endword;
|
||||||
}
|
}
|
||||||
return out.str();
|
return out.str();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user