Resolve "Implement Platform's Testing.Options"
Closes #8 (closed).
- I added a usage example to
Tests/with_options.icl
. - Unless people use
Prop
directly or instantiateTestable
, this should not break any existing programs becausename
still exists. - However, in the old setup it was possible to do e.g.
name "x" (name "y" p)
which would give the namex.y
. This is not possible any more; this now gives justx
. I'm not sure how important the old feature is. In our current ideas, Gast tests are meant to be non-hierarchical because clean-test is used to combine test suites (with the benefit that tests can be compiled separately and other tests can still run when some test has a run-time error), so I don't think it's necessary. It would be possible to add anappendName :: n p -> Property | toString n & Testable p
to useappendName "x" (name "y" p)
forx.y
, but it would be difficult to put this in thename
function which can override an automatically generated name. I currently don't see the use for thisappendName
, but it can be added. - To be able give a name to all properties, I frequently used
thunk_name_to_string
. This can give not-so-nice names (when involving lambda expressions, or for simpleBool
s as inTests/with_options.icl
'snewSet_is_empty
), but it is always possible to override the auto-generated name withname :: n p -> Property | toString n & Testable p
. In the normal case of a non-constant function or aProperty
the auto-generated names are nice (see the example, in whichname
is only used once). - With
--option
it is be possible to setTestoption
s (e.g.--option Trace
,--option 'Tests 50000'
). This usesgParse
. When no--run
is given yet, the options are global.
Edited by Clean Importer