integration-0.1.0
Safe HaskellNone
LanguageGHC2021

Test.Shape

Description

Self-tests for the Shape DSL and shouldMatchShape assertion.

Synopsis

Documentation

testShapeObjectMatch :: HasCallStack => App () Source #

A matching object shape succeeds.

testShapeUnexpectedKey :: HasCallStack => App () Source #

An unexpected key in the actual object causes a failure.

testShapeMissingKey :: HasCallStack => App () Source #

A missing key in the actual object causes a failure.

testShapeWrongTypeObject :: HasCallStack => App () Source #

Providing a non-object value when SObject is expected causes a failure.

testShapeWrongTypeString :: HasCallStack => App () Source #

Providing a non-string when SString is expected causes a failure.

testShapeArrayElementMismatch :: HasCallStack => App () Source #

An array element with the wrong type causes a failure, and the error message includes the element index.

testShapeNestedPathReported :: HasCallStack => App () Source #

A nested mismatch deep in an object/array reports the full JSON path.

testShapeSAny :: HasCallStack => App () Source #

SAny is a wildcard that matches every JSON value.

testShapeEmptyArray :: HasCallStack => App () Source #

An empty array matches SArray with any element shape.

testValueShape :: HasCallStack => App () Source #

valueShape computes the correct shape of a JSON value.