| 32 | }; |
| 33 | |
| 34 | void EvalTruncation(const string& original, const string& expected_result, |
| 35 | int32_t max_length, Truncation boundary) { |
| 36 | string result; |
| 37 | if (boundary == DOWN) { |
| 38 | ASSERT_OK(TruncateDown(original, max_length, &result)); |
| 39 | } else { |
| 40 | ASSERT_OK(TruncateUp(original, max_length, &result)); |
| 41 | } |
| 42 | EXPECT_EQ(expected_result, result); |
| 43 | } |
| 44 | |
| 45 | TEST(TruncateDownTest, Basic) { |
| 46 | EvalTruncation("0123456789", "0123456789", 100, DOWN); |
no test coverage detected