mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
fix(chat-filter): shipped blocklist.dcf in the portable format
The shipped list's hashes are 64-bit FNV-1a (checked against a sample of its words), so it is written again as version 3: same hashes, duplicates dropped, sorted. Nothing else changes; it can be replaced by building from blocklist.txt. issue 215 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
@@ -147,3 +147,12 @@ TEST(ChatFilterCoreTest, DashboardPhrasesInWhitelistChat) {
|
||||
lists.customAllowed.AddEntry("stranger");
|
||||
EXPECT_TRUE(CheckMessage("hello stranger", true, lists).empty());
|
||||
}
|
||||
|
||||
TEST(ChatFilterCoreTest, ShippedBlockListIsPortable) {
|
||||
const auto parsed = dChatFilterDCF::ReadFile(std::string(DLU_SOURCE_DIR) + "/resources/blocklist.dcf");
|
||||
ASSERT_EQ(parsed.status, dChatFilterDCF::eStatus::OK);
|
||||
Lists lists;
|
||||
lists.denied = parsed.list;
|
||||
EXPECT_EQ(CheckMessage("what crap", false, lists), (Spans{ { 5, 4 } }));
|
||||
EXPECT_TRUE(CheckMessage("hello there", false, lists).empty());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user