Misc improvements#17
Merged
mneumann merged 11 commits intosavi-lang:mainfrom Sep 20, 2022
mneumann:misc-improvements
Merged
Conversation
Contributor
mneumann
commented
Sep 20, 2022
- Adds colored output
- Prints ".....F.....F.....F" and then the list of failed asserts
- Prints "FAIL" at the end of the example if any of the asserts had failed and not "OK".
- Adds a Spec that runs a nested Spec :)
- Some misc refactoring (use string interpolation....)
and let the `Spec.Reporter` print to `@env.err`
Pass in `Spec.Statistics.ForExample` to `example_ended`.
This prints output for an example like so: ....F..F.. followed by a list of failures.
Not to be mixed up with ASCII.
jemc
added a commit
that referenced
this pull request
Sep 28, 2022
Prior to #17, `Spec.env` would return a real instance of the `Env`, which the spec examples could use in any way (for example, using it as the root of authority to create a capability object such as with `TCP.auth`). But #17 removed this in favor of a `Spec.Env` abstraction that wraps a possible `Env`, but may not hold a real one. This was done for the purpose of making it possible to test the effects of `Spec.Process.run` in `Spec.Process.Spec`, so that we could have tests in the `Spec` package that test itself. However, it was not actually necessary to remove the real `Env` from `Spec.env` to accomplish this - we can still pass the user code the real `Env`, but use a capturing abstraction for spec effects (i.e. exit code and printed output). This PR renames `Spec.Env` as `_Effects`, and brings back the real `Env` as being present at `Spec.env`, while the internal mechanisms that set the exit code and print results will use `_Effects` instead, such that these effects can still be captured and tested in our self-test. See discussion in Zulip at: https://savi.zulipchat.com/#narrow/stream/294906-libraries/topic/Spec/near/301273284
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.