Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector-unit/trie-expected.txt

Issue 2385093002: DevTools: introduce Trie data structure (Closed)
Patch Set: rebaseline Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 Verify "trie" functionality.
2
3 Test add:
4
5 test: testAddWord
6 trie.add("hello")
7 trie.has("he") = false
8 trie.has("hello") = true
9 trie.has("helloo") = false
10
11 test: testAddWords
12 trie.add("foo")
13 trie.add("bar")
14 trie.add("bazz")
15 trie.has("f") = false
16 trie.has("ba") = false
17 trie.has("baz") = false
18 trie.has("bar") = true
19 trie.has("bazz") = true
20
21 test: testRemoveWord
22 trie.add("foo")
23 trie.remove("f") = false
24 trie.remove("fo") = false
25 trie.remove("fooo") = false
26 trie.has("foo") = true
27 trie.remove("foo") = true
28 trie.has("foo") = false
29
30 test: testWordOverwrite
31 trie.add("foo")
32 trie.add("foo")
33 trie.remove("foo") = true
34 trie.has("foo") = false
35
36 test: testRemoveNonExisting
37 trie.add("foo")
38 trie.remove("bar") = false
39 trie.remove("baz") = false
40 trie.has("foo") = true
41
42 test: testEmptyWord
43 trie.add("")
44 trie.has("") = true
45 trie.remove("") = true
46 trie.has("") = false
47
48 test: testAllWords
49 trie.add("foo")
50 trie.add("bar")
51 trie.add("bazzz")
52 trie.words() = [
53 foo,
54 bar,
55 bazzz
56 ]
57 trie.words("f") = [
58 foo
59 ]
60 trie.words("g") = []
61 trie.words("b") = [
62 bar,
63 bazzz
64 ]
65 trie.words("ba") = [
66 bar,
67 bazzz
68 ]
69 trie.words("bar") = [
70 bar
71 ]
72 trie.words("barz") = []
73 trie.words("baz") = [
74 bazzz
75 ]
76
77 test: testOneCharWords
78 trie.add("a")
79 trie.add("b")
80 trie.add("c")
81 trie.words() = [
82 a,
83 b,
84 c
85 ]
86
87 test: testChainWords
88 trie.add("f")
89 trie.add("fo")
90 trie.add("foo")
91 trie.add("foo")
92 trie.words() = [
93 f,
94 fo,
95 foo
96 ]
97
98 test: testClearTrie
99 trie.add("foo")
100 trie.add("bar")
101 trie.words() = [
102 foo,
103 bar
104 ]
105 trie.clear()
106 trie.words() = []
107
108 test: testLongestPrefix
109 trie.add("fo")
110 trie.add("food")
111 trie.longestPrefix("fear", false) = "f"
112 trie.longestPrefix("fear", true) = ""
113 trie.longestPrefix("football", false) = "foo"
114 trie.longestPrefix("football", true) = "fo"
115 trie.longestPrefix("bar", false) = ""
116 trie.longestPrefix("bar", true) = ""
117
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698