diff options
Diffstat (limited to 'source/blender/blenlib/tests/BLI_string_search_test.cc')
-rw-r--r-- | source/blender/blenlib/tests/BLI_string_search_test.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenlib/tests/BLI_string_search_test.cc b/source/blender/blenlib/tests/BLI_string_search_test.cc index 0d1fd2cab96..aa1c0b41c44 100644 --- a/source/blender/blenlib/tests/BLI_string_search_test.cc +++ b/source/blender/blenlib/tests/BLI_string_search_test.cc @@ -8,6 +8,9 @@ namespace blender::string_search::tests { +/* Right arrow, keep in sync with #UI_MENU_ARROW_SEP in `UI_interface.h`. */ +#define UI_MENU_ARROW_SEP "\xe2\x96\xb6" + TEST(string_search, damerau_levenshtein_distance) { EXPECT_EQ(damerau_levenshtein_distance("test", "test"), 0); @@ -30,14 +33,17 @@ TEST(string_search, get_fuzzy_match_errors) EXPECT_EQ(get_fuzzy_match_errors("", "abc"), 0); EXPECT_EQ(get_fuzzy_match_errors("hello", "hallo"), 1); EXPECT_EQ(get_fuzzy_match_errors("hap", "hello"), -1); - EXPECT_EQ(get_fuzzy_match_errors("armature", "▶restore"), -1); + EXPECT_EQ(get_fuzzy_match_errors("armature", UI_MENU_ARROW_SEP "restore"), -1); } TEST(string_search, extract_normalized_words) { LinearAllocator<> allocator; Vector<StringRef, 64> words; - extract_normalized_words("hello world▶test another test▶ 3", allocator, words); + extract_normalized_words("hello world" UI_MENU_ARROW_SEP "test another test" UI_MENU_ARROW_SEP + " 3", + allocator, + words); EXPECT_EQ(words.size(), 6); EXPECT_EQ(words[0], "hello"); EXPECT_EQ(words[1], "world"); |