5#include "flutter/fml/ascii_trie.h"
7#include "gtest/gtest.h"
11TEST(AsciiTableTest, Simple) {
13 auto entries = std::vector<std::string>{
"foo"};
15 ASSERT_TRUE(trie.
Query(
"foobar"));
16 ASSERT_FALSE(trie.
Query(
"google"));
19TEST(AsciiTableTest, ExactMatch) {
21 auto entries = std::vector<std::string>{
"foo"};
23 ASSERT_TRUE(trie.
Query(
"foo"));
28 ASSERT_TRUE(trie.
Query(
"foo"));
31TEST(AsciiTableTest, MultipleEntries) {
33 auto entries = std::vector<std::string>{
"foo",
"bar"};
35 ASSERT_TRUE(trie.
Query(
"foozzz"));
36 ASSERT_TRUE(trie.
Query(
"barzzz"));
TEST(AsciiTableTest, Simple)
A trie for looking for ASCII prefixes.
bool Query(const char *argument)
Returns true if argument is prefixed by the contents of the trie.
void Fill(const std::vector< std::string > &entries)
Clear and insert all the entries into the trie.
SK_API sk_sp< SkShader > Empty()