-
Notifications
You must be signed in to change notification settings - Fork 99
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
BTrees in Motoko. #396
Draft
matthewhammer
wants to merge
10
commits into
master
Choose a base branch
from
btree-prototype
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
BTrees in Motoko. #396
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c35b3d9
BTree.
matthewhammer b95320f
remove already-stale invariants comment. prefer Check module.
matthewhammer d81a1c3
revised definition. wrote find. checks need revision.
matthewhammer 142a0d0
simplify type defs.
matthewhammer ffd99ec
adjust Check module.
matthewhammer 61334ec
fix issues and unit test.
matthewhammer 0d06506
missing file: BTreeTest.mo
matthewhammer 273fb6f
simpler public API; unit test for find.
matthewhammer 9db84ca
internal compiler error. const ... captures ..., not found in static …
matthewhammer 4393a81
workaround compiler issue.
matthewhammer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
👍 To using matchers instead of debug statements for tests.
This is the pattern I've been using for my tests.
I create a "suite" for a specific function, like here where I have all of the different test cases for that function inside it.
Then I run the test suite for each function here.
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.
For me, it's not one or the other. It's "which here?" -- Like all tools and techniques, there is a place for matches, but it's not a universal solution, or even close to one.
For instance, what value would it add to the first tests, where I just want to define a bunch of trees using
let
expressions that scope in a nested way, and assert that they are valid? To me, plain Motoko is the right structure for that test, and I used Debug prints so I know where I am in that script.How does matchers help there? I can't see it -- It's not really helping guide that sort of test structure at all, and that's fine. I think it's okay to use it only where it helps --- organizing tests of an API, ensuring that each operation has some coverage. (I plan to use it for the rest of the API coverage tests.)