plutus-core-1.60.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Tasty.Extras

Synopsis

Documentation

newtype Layer a r #

A monad allowing one to emit elements of type a. Semantically equivalent to Writer (DList a) r, but:

  1. is faster, being based on the Church-encoded free monad
  2. implements Monoid, so that all the Data.Foldable convenience is supported
  3. has better ergonomics as it doesn't require the user to wrap a values into DLists

This type is also semantically equivalent to Stream (Of a) Identity r.

Useful for monadically creating tree-like structures, for example the following

import Data.Tree
yield = embed . pure
main = putStrLn . drawTree . Node "a" . toList $ do
    yield "b"
    nestWith (Node "c") $ do
        yield "d"
        yield "e"
    yield "f"

will produce

-a
|
+- b
|
+- c
|  |
|  +- d
|  |
|  `- e
|
`- f

Constructors

Layer 

Fields

nestWith :: ([a] -> a) -> Layer a () -> Layer a () #

Collapse the given Layer into a single element by converting it into a list, applying the given function to the result and embedding it back.

newtype TestNestedM r #

Constructors

TestNestedM 

Fields

testNestedNamed #

Arguments

:: Text using a predicate.

makeVersionedFilePath :: [FilePath] -> FilePath -> FilePath #

Given a lists of FilePaths and a filename, concatenate the members of the list together, append the GHC version number, then append the filename. We use this to create GHC-version-dependent golden files.

Prettier equality assertions

assertEqualPretty #

Arguments

:: (Assertion 

Asserts that the specified actual value is equal to the expected value. The output message will contain the prefix, the expected value, and the actual value.

If the prefix is the empty string (i.e., ""), then the prefix is omitted and only the expected and actual values are output.

(%=?) infix 1 #

Arguments

:: (Assertion 

Asserts that the specified actual value is equal to the expected value (with the expected value on the left-hand side).

(%?=) infix 1 #

Arguments

:: (Assertion 

Asserts that the specified actual value is equal to the expected value (with the actual value on the left-hand side).

ignoreTestWhenHpcEnabled :: TestTree #

Some tests inspect GHC code, but GHC code gets instrumented when using HPC (Haskell Program Coverage), which causes those tests to fail. This function disables those tests when the custom HPC_ENABLED flag is defined.