Skip to content

Commit

Permalink
StrTrie - LoadFromStreamSomeWordsTooLong
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbymcr committed May 25, 2019
1 parent 4d17626 commit 3dee9d8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/Words.Native.Test/StrTrieTest.cpp
Expand Up @@ -144,6 +144,16 @@ namespace Words
Assert::AreEqual(StrTrie::Terminal, trie.find("LONG"));
}

TEST_METHOD(LoadFromStreamSomeWordsTooLong)
{
stringstream stream;
StrTrie trie(Load(stream, { "OK", "OKAY", "THISISTOOLONG", "YES" }));

Assert::AreEqual(size_t(2), trie.size());
Assert::AreEqual(StrTrie::Terminal, trie.find("OKAY"));
Assert::AreEqual(StrTrie::Terminal, trie.find("YES"));
}

private:

istream& Load(stringstream & stream, initializer_list<const char*> lines)
Expand Down

0 comments on commit 3dee9d8

Please sign in to comment.