2022-04-20 18:28:13 -06:00
|
|
|
|
2022-11-28 18:31:10 -07:00
|
|
|
#include "MiscUtils.h"
|
|
|
|
#include <gtest/gtest.h>
|
2022-04-20 18:28:13 -06:00
|
|
|
#include <string>
|
|
|
|
|
2022-11-28 18:31:10 -07:00
|
|
|
TEST(MiscUtils, wordwrap) {
|
|
|
|
std::vector<std::string> result;
|
2022-04-20 18:28:13 -06:00
|
|
|
|
2022-11-28 18:31:10 -07:00
|
|
|
word_wrap(&result, "123", 3);
|
|
|
|
ASSERT_EQ(result.size(), 1);
|
2022-04-20 18:28:13 -06:00
|
|
|
|
2022-11-28 18:31:10 -07:00
|
|
|
result.clear();
|
2022-11-29 16:05:04 -07:00
|
|
|
word_wrap(&result, "123456", 3);
|
2022-11-28 18:31:10 -07:00
|
|
|
ASSERT_EQ(result.size(), 2);
|
2022-04-20 18:28:13 -06:00
|
|
|
|
2022-11-28 18:31:10 -07:00
|
|
|
result.clear();
|
|
|
|
word_wrap(&result, "1234567", 3);
|
|
|
|
ASSERT_EQ(result.size(), 3);
|
2022-04-20 18:28:13 -06:00
|
|
|
}
|