Re: Comments on Arthur's test framework
Per Bothner 23 Aug 2020 00:40 UTC
On 8/22/20 5:21 PM, Arthur A. Gleckler wrote:
> On Sat, Aug 22, 2020 at 4:45 PM Per Bothner <xxxxxx@bothner.com <mailto:xxxxxx@bothner.com>> wrote:
>
> It does allow doing tests in the REPL:
>
>
> Yes, that's cool, but isn't that just one run? The value of tests is being able to run them over and over again, and names enable one to choose which subset to run and to identify which ones fail.
However, requiring each test to have a name is a hurdle/annoyance/inconvenience to writing tests.
You don't want unnecessary hurdles/annoyances/inconveniences to writing tests.
Requiring a name for each test seems like a major design mistake - not everyone is as
disciplined as you are.
If the implementation can tie line numbers to each test, that seems like a
much easier automatic default way to name tests. (SRFI 64 at this time doesn't have
have a way to enable/skip tests based on line numbers, but it could be added.)
An idea for a useful tool would convert a test-suite to a functionally-equivalent one,
but each test that does not have an explicit name would have a default name of the format "FILENAME:LINE".
(It may be hard to write that in portable Scheme but it doesn't have to be 100% robust.)
--
--Per Bothner
xxxxxx@bothner.com http://per.bothner.com/