Skip to content

Allow marking an example as should-fail #397

Closed
@petertseng

Description

@petertseng

As an extension to multiple examples in #395, we'd like to be able to add examples that we can mark as expected to fail the test.

We can use this to make sure that our test cases properly reject some mistaken solutions that we expect them to reject. The example I gave earlier: In accumulate, we have an inefficient example noted at https://github.com/exercism/xhaskell/blob/master/exercises/accumulate/src/Example.hs#L15 and we say that it should fail the test suite. But this was never automatically verified and indeed for the longest time that example did not even compile until #209

The things to figure out here are:

  • How will it be specified? e.g. the name of the directory contains SHOULDFAIL? Or something else?
  • After it is specified, ideas on implementation? Something to do with checking the exit status of stack test, of course. We'll have to keep in mind that we usually have set -e on, but this time we have to invert the exit code of stack test. Maybe something can do that for us. Maybe simply the ! operator will work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions