Skip to content
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

Merged
merged 3 commits into from
Nov 2, 2020
Merged

Trie #27

merged 3 commits into from
Nov 2, 2020

Conversation

happy-san
Copy link
Collaborator

@code-shoily
Copy link
Owner

What about tests?

List _split(V value) {
List<V> list = splitter(value);
for (var component in list) {
if (!components.contains(component)) throw ('$component ∉ $components');
Copy link
Owner

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.

@happy-san
Copy link
Collaborator Author

Yeah, will implement tests in a bit. Wasn't sure about the splitter approach. Thanks for reviewing.

@happy-san happy-san force-pushed the trie branch 5 times, most recently from f913b97 to 620c424 Compare November 1, 2020 23:07
});

test('Empty trie', () {
expect(emptyTrie.isEmpty, true);
Copy link
Owner

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?

expect(trie.components,
{...List.generate(26, (i) => String.fromCharCode(122 - i))});

expect(customTrie.components, {'f', 'o', 'b', 'a', 'r', 'z'});
Copy link
Owner

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'}))

@happy-san happy-san merged commit 1920ad5 into code-shoily:master Nov 2, 2020
@happy-san happy-san deleted the trie branch November 2, 2020 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants