Skip to content

Resolve "Implement Platform's Testing.Options"

Clean Importer requested to merge 8-implement-platform-s-testing-options into master

Closes #8 (closed).

  • I added a usage example to Tests/with_options.icl.
  • Unless people use Prop directly or instantiate Testable, this should not break any existing programs because name still exists.
  • However, in the old setup it was possible to do e.g. name "x" (name "y" p) which would give the name x.y. This is not possible any more; this now gives just x. 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 an appendName :: n p -> Property | toString n & Testable p to use appendName "x" (name "y" p) for x.y, but it would be difficult to put this in the name function which can override an automatically generated name. I currently don't see the use for this appendName, 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 simple Bools as in Tests/with_options.icl's newSet_is_empty), but it is always possible to override the auto-generated name with name :: n p -> Property | toString n & Testable p. In the normal case of a non-constant function or a Property the auto-generated names are nice (see the example, in which name is only used once).
  • With --option it is be possible to set Testoptions (e.g. --option Trace, --option 'Tests 50000'). This uses gParse. When no --run is given yet, the options are global.
Edited by Clean Importer

Merge request reports