| OLD | NEW |
| 1 <html> | |
| 2 <head> | |
| 3 <base href="/inspector-debug/"></base> | |
| 4 <script src="/inspector-debug/Runtime.js"></script> | |
| 5 <script src="/inspector-unit/inspector-unit-test.js"></script> | |
| 6 <script> | |
| 7 function test() { | 1 function test() { |
| 8 var trie; | 2 var trie; |
| 3 UnitTest.addResult(`Verify "trie" functionality.`); |
| 9 | 4 |
| 10 UnitTest.runTests([ | 5 UnitTest.runTests([ |
| 11 function testAddWord() | 6 function testAddWord() |
| 12 { | 7 { |
| 13 var trie = new Common.Trie(); | 8 var trie = new Common.Trie(); |
| 14 addWord(trie, "hello"); | 9 addWord(trie, "hello"); |
| 15 hasWord(trie, "he"); | 10 hasWord(trie, "he"); |
| 16 hasWord(trie, "hello"); | 11 hasWord(trie, "hello"); |
| 17 hasWord(trie, "helloo"); | 12 hasWord(trie, "helloo"); |
| 18 }, | 13 }, |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 function clear(trie) | 162 function clear(trie) |
| 168 { | 163 { |
| 169 trie.clear(); | 164 trie.clear(); |
| 170 UnitTest.addResult("trie.clear()"); | 165 UnitTest.addResult("trie.clear()"); |
| 171 } | 166 } |
| 172 | 167 |
| 173 function longestPrefix(trie, word, fullWordOnly) | 168 function longestPrefix(trie, word, fullWordOnly) |
| 174 { | 169 { |
| 175 UnitTest.addResult(`trie.longestPrefix("${word}", ${fullWordOnly}) = "${
trie.longestPrefix(word, fullWordOnly)}"`); | 170 UnitTest.addResult(`trie.longestPrefix("${word}", ${fullWordOnly}) = "${
trie.longestPrefix(word, fullWordOnly)}"`); |
| 176 } | 171 } |
| 177 } | 172 } |
| 178 </script> | |
| 179 </head> | |
| 180 <body> | |
| 181 Verify "trie" functionality. | |
| 182 </body> | |
| 183 </html> | |
| OLD | NEW |