-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trie #27
Trie #27
Conversation
What about tests? |
List _split(V value) { | ||
List<V> list = splitter(value); | ||
for (var component in list) { | ||
if (!components.contains(component)) throw ('$component ∉ $components'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try throwing an error object instead, easily shareable and testable.
Yeah, will implement tests in a bit. Wasn't sure about the splitter approach. Thanks for reviewing. |
f913b97
to
620c424
Compare
test/trie/trie_test.dart
Outdated
}); | ||
|
||
test('Empty trie', () { | ||
expect(emptyTrie.isEmpty, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use isTrue and isFalse instead of true and false?
test/trie/trie_test.dart
Outdated
expect(trie.components, | ||
{...List.generate(26, (i) => String.fromCharCode(122 - i))}); | ||
|
||
expect(customTrie.components, {'f', 'o', 'b', 'a', 'r', 'z'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(customTrie.components, equals({'f', 'o', 'b', 'a', 'r', 'z'}))
#19 @code-shoily