Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
ascii_trie_unittests.cc File Reference
#include "flutter/fml/ascii_trie.h"
#include "gtest/gtest.h"

Go to the source code of this file.

Functions

 TEST (AsciiTableTest, Simple)
 
 TEST (AsciiTableTest, ExactMatch)
 
 TEST (AsciiTableTest, Empty)
 
 TEST (AsciiTableTest, MultipleEntries)
 

Function Documentation

◆ TEST() [1/4]

TEST ( AsciiTableTest  ,
Empty   
)

Definition at line 26 of file ascii_trie_unittests.cc.

26 {
27 AsciiTrie trie;
28 ASSERT_TRUE(trie.Query("foo"));
29}
A trie for looking for ASCII prefixes.
Definition ascii_trie.h:15
bool Query(const char *argument)
Returns true if argument is prefixed by the contents of the trie.
Definition ascii_trie.h:26

◆ TEST() [2/4]

TEST ( AsciiTableTest  ,
ExactMatch   
)

Definition at line 19 of file ascii_trie_unittests.cc.

19 {
20 AsciiTrie trie;
21 auto entries = std::vector<std::string>{"foo"};
22 trie.Fill(entries);
23 ASSERT_TRUE(trie.Query("foo"));
24}
void Fill(const std::vector< std::string > &entries)
Clear and insert all the entries into the trie.
Definition ascii_trie.cc:34

◆ TEST() [3/4]

TEST ( AsciiTableTest  ,
MultipleEntries   
)

Definition at line 31 of file ascii_trie_unittests.cc.

31 {
32 AsciiTrie trie;
33 auto entries = std::vector<std::string>{"foo", "bar"};
34 trie.Fill(entries);
35 ASSERT_TRUE(trie.Query("foozzz"));
36 ASSERT_TRUE(trie.Query("barzzz"));
37}

◆ TEST() [4/4]

TEST ( AsciiTableTest  ,
Simple   
)

Definition at line 11 of file ascii_trie_unittests.cc.

11 {
12 AsciiTrie trie;
13 auto entries = std::vector<std::string>{"foo"};
14 trie.Fill(entries);
15 ASSERT_TRUE(trie.Query("foobar"));
16 ASSERT_FALSE(trie.Query("google"));
17}