Skip to content

Commit

Permalink
Add test for character_count with \N and friends
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1t3cht committed Dec 1, 2023
1 parent b7f6be5 commit be18d61
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/tests/character_count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ TEST(lagi_character_count, ignore_whitespace) {
EXPECT_EQ(5, agi::CharacterCount("h e l l o ", agi::IGNORE_WHITESPACE));
}

TEST(lagi_character_count, ignore_whitespace_commands) {
EXPECT_EQ(10, agi::CharacterCount("hello world", agi::IGNORE_WHITESPACE));
EXPECT_EQ(10, agi::CharacterCount("hello\\nworld", agi::IGNORE_WHITESPACE));
EXPECT_EQ(10, agi::CharacterCount("hello\\Nworld", agi::IGNORE_WHITESPACE));
EXPECT_EQ(10, agi::CharacterCount("hello\\hworld", agi::IGNORE_WHITESPACE));
EXPECT_EQ(12, agi::CharacterCount("hello\\Nworld", agi::IGNORE_NONE));
}

TEST(lagi_character_count, ignore_blocks_and_punctuation) {
EXPECT_EQ(5, agi::CharacterCount("{asdf}hello.", agi::IGNORE_PUNCTUATION | agi::IGNORE_BLOCKS));
}
Expand Down

0 comments on commit be18d61

Please sign in to comment.