REFACTOR: move run-tests and fix the std assert namespace#9303
Merged
fdncred merged 4 commits intonushell:mainfrom May 27, 2023
Merged
REFACTOR: move run-tests and fix the std assert namespace#9303fdncred merged 4 commits intonushell:mainfrom
run-tests and fix the std assert namespace#9303fdncred merged 4 commits intonushell:mainfrom
Conversation
- rename `assert` into `main` - remove the `assert` in front of all the commands - use `alias "core foo" = foo` to avoid shadowing them completely
Contributor
|
👍🏻 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
related to the namespace bullet point in
Description
this was the last module of the standard library with a broken namespace, this PR takes care of this.
run-testshas been moved tostd/mod.nustd/testing.nuhas been moved tostd/assert.nuassertis now calledmainand used in all the otherstd assertcommandsstd assert lengthandstd assert str contains, in order not to shadow the built-inlengthandstr containscommands, i've usedalias "core ..." = ...to (1) definefooinassert.nuand (2) still use the builtinfoowithcore foo(replacefoobylengthorstr contains)User-Facing Changes
one can not use
anymore because
assert ...is not exported fromstd.std assertis now a real module.Tests + Formatting
toolkit fmttoolkit clippytoolkit testtoolkit test stdlibAfter Submitting
Notes for reviewers
to test this, i think the easiest is to
toolkit test stdliband see all the tests passcargo run -- -nand tryuse std assert=> are all the commands available in scope?