Skip to content

[#210] Refactor integrational testing engine and its interface

Diogo Castro requested to merge dfacastro/#210-refactor-integrational into master

Description

Problem: The way the testing engine works (keep going even a contract interpretation error occurs, use Either+Validated to check the engine state) is in stark contrast with the standard way of writing testing frameworks in Haskell (errors are thrown in MonadError/MonadThrow, execution stops unless caught with catchError/catch). Over time this has proven to be an inconvenience.

Solution:

  • Removed Validated, IntegrationalValidator, SuccessValidator.
  • Removed expectAnySuccess
  • Make use of MonadError to signal/inspect contract interpretation errors.
  • For simplification, validate was removed from the public interface

Related issue(s)

Resolves #210 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Diogo Castro

Merge request reports