Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internal building-blocks for JSON Value
expectations
Synopsis
- assertBoolWithDiff :: HasCallStack => Bool -> Text -> Text -> IO ()
- newtype Superset = Superset Value
- newtype Subset = Subset Value
- pruneJson :: Superset -> Subset -> Value
- newtype Sortable = Sortable Value
- sortJsonArrays :: Value -> Value
- vectorSortOn :: Ord b => (a -> b) -> Vector a -> Vector a
- normalizeScientific :: Value -> Value
Pretty diff
assertBoolWithDiff :: HasCallStack => Bool -> Text -> Text -> IO () Source #
Pruning Object
s
Sorting Array
s
sortJsonArrays :: Value -> Value Source #
Dealing with Scientific
normalizeScientific :: Value -> Value Source #
Normalize all Number
values to Double
precision
Internally, 1
and 1.0
are represented as different values of the
Scientific
data type. These will compare equally, but if there is some
other difference that fails the assertion, they will render as a difference
in the message, confusing the reader.
This sends them through an id
function as Double
, which will make either
print as 1.0
consistently.