feat: finish string strip (maybe)
This commit is contained in:
@ -74,22 +74,22 @@ namespace yycctest::string::op {
|
||||
TEST(StringOp, Strip) {
|
||||
// Normal strip
|
||||
{
|
||||
auto rv = OP::to_strip(u8" \taaa\n", u8" \t\r\n");
|
||||
auto rv = OP::strip(u8" \taaa\n", u8" \t\r\n");
|
||||
EXPECT_EQ(rv, u8"aaa");
|
||||
}
|
||||
|
||||
// Special strip
|
||||
{
|
||||
auto rv = OP::to_strip(u8"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>aaa<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", u8"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
auto rv = OP::strip(u8"啊啊啊aaaあああ", u8"啊あ");
|
||||
EXPECT_EQ(rv, u8"aaa");
|
||||
}
|
||||
{
|
||||
auto rv = OP::to_strip(u8"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>aaa<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", u8"<EFBFBD><EFBFBD>");
|
||||
EXPECT_EQ(rv, u8"aaa<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
auto rv = OP::strip(u8"啊啊啊aaaあああ", u8"啊");
|
||||
EXPECT_EQ(rv, u8"aaaあああ");
|
||||
}
|
||||
{
|
||||
auto rv = OP::to_strip(u8"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>aaa<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", u8"<EFBFBD><EFBFBD>");
|
||||
EXPECT_EQ(rv, u8"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>aaa");
|
||||
auto rv = OP::strip(u8"啊啊啊aaaあああ", u8"あ");
|
||||
EXPECT_EQ(rv, u8"啊啊啊aaa");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user