mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add util::crop_utf8 (stringutil)
This commit is contained in:
parent
b34fddbe94
commit
25bdcc8e1b
3 changed files with 38 additions and 0 deletions
10
test/util/stringutil.cpp
Normal file
10
test/util/stringutil.cpp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include "util/stringutil.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(stringutil, crop_utf8) {
|
||||
// Project source files must be UTF-8 encoded
|
||||
std::string str = "пример";
|
||||
str = str.substr(0, util::crop_utf8(str, 7));
|
||||
EXPECT_EQ(str, "при");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue