Skip to content

Commit 17a6cab

Browse files
committed
Update FilterExpression_test.cpp
1 parent 889fc79 commit 17a6cab

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

Testing/GoogleTest/FilterEngine/FilterExpression_test.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,11 +1635,11 @@ TEST_P(FilterExpressionTest, ReplaceWithList)
16351635
EXPECT_TRUE(file.OpenCreateUtf8(replaceListPath));
16361636
file.WriteBom();
16371637
file.WriteString(L"# Comment line\n");
1638-
file.WriteString(L"apple\tりんご\n");
1639-
file.WriteString(L"orange\tオレンジ\n");
1640-
file.WriteString(L"banana\tバナナ\n");
1638+
file.WriteString(L"apple\t\u308a\u3093\u3054\n"); // りんご
1639+
file.WriteString(L"orange\t\u30aa\u30ec\u30f3\u30b8\n"); // オレンジ
1640+
file.WriteString(L"banana\t\u30d0\u30ca\u30ca\n"); // バナナ
16411641
file.WriteString(L"# Another comment\n");
1642-
file.WriteString(L"grape\tぶどう\n");
1642+
file.WriteString(L"grape\t\u3076\u3069\u3046\n"); // ぶどう
16431643
file.Close();
16441644
}
16451645

@@ -1658,45 +1658,45 @@ TEST_P(FilterExpressionTest, ReplaceWithList)
16581658
GetOptionsMgr()->InitOption(OPT_CP_DETECT, 0);
16591659

16601660
// Test replaceWithList function
1661-
EXPECT_TRUE(fe.Parse("replaceWithList(\"I like apple and orange\", \"" + ucr::toUTF8(replaceListPath) + "\") == \"I like りんご and オレンジ\""));
1661+
EXPECT_TRUE(fe.Parse(u8"replaceWithList(\"I like apple and orange\", \"" + ucr::toUTF8(replaceListPath) + u8"\") == \"I like りんご and オレンジ\""));
16621662
EXPECT_TRUE(fe.Evaluate(di));
16631663

1664-
EXPECT_TRUE(fe.Parse("replaceWithList(\"banana is yellow\", \"" + ucr::toUTF8(replaceListPath) + "\") == \"バナナ is yellow\""));
1664+
EXPECT_TRUE(fe.Parse(u8"replaceWithList(\"banana is yellow\", \"" + ucr::toUTF8(replaceListPath) + u8"\") == \"バナナ is yellow\""));
16651665
EXPECT_TRUE(fe.Evaluate(di));
16661666

1667-
EXPECT_TRUE(fe.Parse("replaceWithList(\"grape juice\", \"" + ucr::toUTF8(replaceListPath) + "\") == \"ぶどう juice\""));
1667+
EXPECT_TRUE(fe.Parse("replaceWithList(\"grape juice\", \"" + ucr::toUTF8(replaceListPath) + u8"\") == \"ぶどう juice\""));
16681668
EXPECT_TRUE(fe.Evaluate(di));
16691669

16701670
// Multiple replacements in one string
1671-
EXPECT_TRUE(fe.Parse("replaceWithList(\"apple orange banana\", \"" + ucr::toUTF8(replaceListPath) + "\") == \"りんご オレンジ バナナ\""));
1671+
EXPECT_TRUE(fe.Parse("replaceWithList(\"apple orange banana\", \"" + ucr::toUTF8(replaceListPath) + u8"\") == \"りんご オレンジ バナナ\""));
16721672
EXPECT_TRUE(fe.Evaluate(di));
16731673

16741674
// No match
1675-
EXPECT_TRUE(fe.Parse("replaceWithList(\"watermelon\", \"" + ucr::toUTF8(replaceListPath) + "\") == \"watermelon\""));
1675+
EXPECT_TRUE(fe.Parse("replaceWithList(\"watermelon\", \"" + ucr::toUTF8(replaceListPath) + u8"\") == \"watermelon\""));
16761676
EXPECT_TRUE(fe.Evaluate(di));
16771677

16781678
// Empty string
1679-
EXPECT_TRUE(fe.Parse("replaceWithList(\"\", \"" + ucr::toUTF8(replaceListPath) + "\") == \"\""));
1679+
EXPECT_TRUE(fe.Parse("replaceWithList(\"\", \"" + ucr::toUTF8(replaceListPath) + u8"\") == \"\""));
16801680
EXPECT_TRUE(fe.Evaluate(di));
16811681

16821682
// Array of strings
1683-
EXPECT_TRUE(fe.Parse("replaceWithList(array(\"apple\", \"banana\"), \"" + ucr::toUTF8(replaceListPath) + "\") == array(\"りんご\", \"バナナ\")"));
1683+
EXPECT_TRUE(fe.Parse(u8"replaceWithList(array(\"apple\", \"banana\"), \"" + ucr::toUTF8(replaceListPath) + u8"\") == array(\"りんご\", \"バナナ\")"));
16841684
EXPECT_TRUE(fe.Evaluate(di));
16851685

16861686
// Case-insensitive: uppercase input matches lowercase pattern
1687-
EXPECT_TRUE(fe.Parse("replaceWithList(\"APPLE\", \"" + ucr::toUTF8(replaceListPath) + "\") == \"りんご\""));
1687+
EXPECT_TRUE(fe.Parse(u8"replaceWithList(\"APPLE\", \"" + ucr::toUTF8(replaceListPath) + u8"\") == \"りんご\""));
16881688
EXPECT_TRUE(fe.Evaluate(di));
16891689

16901690
// Case-insensitive: mixed case input
1691-
EXPECT_TRUE(fe.Parse("replaceWithList(\"Apple is good\", \"" + ucr::toUTF8(replaceListPath) + "\") == \"りんご is good\""));
1691+
EXPECT_TRUE(fe.Parse(u8"replaceWithList(\"Apple is good\", \"" + ucr::toUTF8(replaceListPath) + u8"\") == \"りんご is good\""));
16921692
EXPECT_TRUE(fe.Evaluate(di));
16931693

16941694
// Case-insensitive: multiple mixed-case words
1695-
EXPECT_TRUE(fe.Parse("replaceWithList(\"ORANGE and Banana\", \"" + ucr::toUTF8(replaceListPath) + "\") == \"オレンジ and バナナ\""));
1695+
EXPECT_TRUE(fe.Parse(u8"replaceWithList(\"ORANGE and Banana\", \"" + ucr::toUTF8(replaceListPath) + u8"\") == \"オレンジ and バナナ\""));
16961696
EXPECT_TRUE(fe.Evaluate(di));
16971697

16981698
// Case-insensitive: array with mixed case
1699-
EXPECT_TRUE(fe.Parse("replaceWithList(array(\"APPLE\", \"GRAPE\"), \"" + ucr::toUTF8(replaceListPath) + "\") == array(\"りんご\", \"ぶどう\")"));
1699+
EXPECT_TRUE(fe.Parse(u8"replaceWithList(array(\"APPLE\", \"GRAPE\"), \"" + ucr::toUTF8(replaceListPath) + u8"\") == array(\"りんご\", \"ぶどう\")"));
17001700
EXPECT_TRUE(fe.Evaluate(di));
17011701

17021702
// Test regexReplaceWithList function
@@ -1761,7 +1761,7 @@ TEST_P(FilterExpressionTest, ReplaceWithListAdvanced)
17611761
EXPECT_TRUE(file.OpenCreateUtf8(replaceListPath));
17621762
file.WriteBom();
17631763
file.WriteString(L"# Test special characters\n");
1764-
file.WriteString(L"C++\tCプラプラ\n");
1764+
file.WriteString(L"C++\tC\u30d7\u30e9\u30d7\u30e9\n"); // Cプラプラ
17651765
file.WriteString(L"a\tb\tc\td\n"); // Extra tabs should be ignored
17661766
file.WriteString(L"\n"); // Empty line should be skipped
17671767
file.WriteString(L"test\t\n"); // Replace with empty string
@@ -1783,7 +1783,7 @@ TEST_P(FilterExpressionTest, ReplaceWithListAdvanced)
17831783
GetOptionsMgr()->InitOption(OPT_CP_DETECT, 0);
17841784

17851785
// Test special characters
1786-
EXPECT_TRUE(fe.Parse("replaceWithList(\"I love C++\", \"" + ucr::toUTF8(replaceListPath) + "\") == \"I love Cプラプラ\""));
1786+
EXPECT_TRUE(fe.Parse(u8"replaceWithList(\"I love C++\", \"" + ucr::toUTF8(replaceListPath) + u8"\") == \"I love Cプラプラ\""));
17871787
EXPECT_TRUE(fe.Evaluate(di));
17881788

17891789
// Test extra tabs (should only use first two fields)
@@ -1836,12 +1836,12 @@ TEST_P(FilterExpressionTest, ReplaceWithListEncoding)
18361836
UniStdioFile file;
18371837
EXPECT_TRUE(file.OpenCreateUtf8(replaceListPath));
18381838
file.WriteBom();
1839-
file.WriteString(L"# 日本語のテスト\n");
1840-
file.WriteString(L"こんにちは\thello\n");
1841-
file.WriteString(L"さようなら\tgoodbye\n");
1842-
file.WriteString(L"ありがとう\tthank you\n");
1843-
file.WriteString(L"\tdog\n");
1844-
file.WriteString(L"\tcat\n");
1839+
file.WriteString(L"# \u65e5\u672c\u8a9e\u306e\u30c6\u30b9\u30c8\n"); // 日本語のテスト
1840+
file.WriteString(L"\u3053\u3093\u306b\u3061\u306f\thello\n"); // こんにちは
1841+
file.WriteString(L"\u3055\u3088\u3046\u306a\u3089\tgoodbye\n"); // さようなら
1842+
file.WriteString(L"\u3042\u308a\u304c\u3068\u3046\tthank you\n"); // ありがとう
1843+
file.WriteString(L"\u72ac\tdog\n"); //
1844+
file.WriteString(L"\u732b\tcat\n"); //
18451845
file.Close();
18461846
}
18471847

0 commit comments

Comments
 (0)