On Sat, May 23, 2020 at 9:54 AM Shriram Krishnamurthi <s...@cs.brown.edu>
wrote:

> Thank you all!
>
> *Dave*, the documentation style is fine, it's sometimes easier to read
> the doc right next to the implementation. (-:
>
> However, I'm not quite sure how even your example works. Maybe someone can
> check my logic? For instance, you say you want to write tests like
>
>     (unless (is os 'windows) (ok test-that-won't-pass-on-windows))
>
> However, `is` seems to return the same value no matter whether the test
> passed or failed: it returns the first argument, *irrespective* of the
> outcome of the test. So in the above test, the returned value is going to
> be that of `os`, which is presumably some non-false value. That means the
> guarded test will *never* be run, on any OS.
>

You're absolutely right -- that should have been an `ok`, not an `is`.


> [Separately, I'm not sure why one would use a testing utility in that
> conditional, rather than just a standard conditional, but that's a
> different matter.]
>

A standard conditional would say "If we are being run on Windows...", where
the `ok` is saying "I expect that this test file is being run on Windows".


> In general, this seems to be a property of your underlying function,
> `test-more-check`: it returns either the return value sent in through
> #:return or the value in the checked position (#:got). But in either case,
> this is independent of the success of the test. The only difference is in
> the *message*, which is printed as output. I suppose I could parameterize
> where it's printed and capture it — but then I have to parse all the
> information back out. I'm just not seeing how to compositionally use your
> testing primitives?
>

Number of success and failures is available through (tests-passed) and
(tests-failed), so that's one option. (current-test-num), (inc-test-num!),
and (next-test-num) allow you to determine and modify the number of tests
that will be reported, so you can conditionally run a test and then pretend
it didn't happen if you don't like the outcome.   `ok` returns a boolean so
it can be used to conditionally run groups of tests.  The other functions
return their argument so you can chain it through a series of tests.

I'd be delighted to add more options if I knew that other people were using
the package -- just let me know.


> As an aside, when trying to install the package in a Docker container
> running Ubuntu 18.04 with Racket 7.7 installed, I got this error:
>
> raco setup: docs failure: query-exec: unable to open the database file
>   error code: 14
>   SQL: "ATTACH $1 AS other"
>   database: #<path:/root/.racket/7.7/doc/docindex.sqlite>
>   mode: 'read-only
>   file permissions: (write read)
>
> which I didn't get on macOS Catalina. The package certainly has a … lot of
> stuff! Even links to EDGAR filings. (-:
>

Yeah, it's an absolute junkpile.  When I was learning Racket I wrote all
these things but didn't have the sense to put them in separate modules.
Now that I'm older and hopefully wiser, in my Copious Free Time I'm working
on splitting it all into stand-alone modules and documenting everything,
but that's going slowly.  If test-more looks like something you might use
then I'll prioritize it so that you aren't stuck with the rest of the
kitchen sink.



> Thanks,
> Shriram
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAJUf2yS7%2B2OSq899U5%2BQrgZwFNwdowQNdByU4AkxxwK%3Dby5wOQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAJUf2yS7%2B2OSq899U5%2BQrgZwFNwdowQNdByU4AkxxwK%3Dby5wOQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKod8%3DjzYFbbtz5_mp15cYxUq3gOQhf9UWmZtPo5z5a-pXw%40mail.gmail.com.

Reply via email to