X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Futil_test.cc;h=49d0b3bc297ab3458ddae7ab6691234a1508b636;hb=57d76e4bdea59aa833f5fb75697bcfbebc18cc3a;hp=872e6f885c03580efe104bc833d19622f4babba3;hpb=ce73eaf7875a9a3326afcd839ad85eb95879c160;p=dcpomatic.git diff --git a/test/util_test.cc b/test/util_test.cc index 872e6f885..49d0b3bc2 100644 --- a/test/util_test.cc +++ b/test/util_test.cc @@ -147,3 +147,11 @@ BOOST_AUTO_TEST_CASE (copy_in_bits_test) check_file ("build/test/random.dat", "build/test/random.dat2"); } } + + +BOOST_AUTO_TEST_CASE(word_wrap_test) +{ + BOOST_CHECK_EQUAL(word_wrap("hello world", 8), "hello \nworld\n"); + BOOST_CHECK(word_wrap("hello this is a longer bit of text and it should be word-wrapped", 31) == string{"hello this is a longer bit of \ntext and it should be word-\nwrapped\n"}); + BOOST_CHECK_EQUAL(word_wrap("hellocan'twrapthissadly", 5), "hello\ncan't\nwrapt\nhissa\ndly\n"); +}