Skip to content

Misc improvements#17

Merged
mneumann merged 11 commits intosavi-lang:mainfrom
mneumann:misc-improvements
Sep 20, 2022
Merged

Misc improvements#17
mneumann merged 11 commits intosavi-lang:mainfrom
mneumann:misc-improvements

Conversation

@mneumann
Copy link
Copy Markdown
Contributor

  • 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....)

@mneumann mneumann requested a review from jemc September 20, 2022 00:29
Copy link
Copy Markdown
Contributor

@jemc jemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mneumann mneumann merged commit bdbe58e into savi-lang:main Sep 20, 2022
@mneumann mneumann deleted the misc-improvements branch September 20, 2022 09:33
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
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