Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- assertEqualModuloDesc ∷ (HasCallStack, MonadIO m, MonadTest m) ⇒ FilePath → FilePath → m ()
- assertHasKeys ∷ HasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ [Text] → FilePath → m ()
- assertHasMappings ∷ HasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ [(Text, Text)] → FilePath → m ()
Documentation
assertEqualModuloDesc Source #
∷ (HasCallStack, MonadIO m, MonadTest m) | |
⇒ FilePath | The file of the first generated verification key |
→ FilePath | The file of the second generated verification key, i.e. the one generated by calling "key verification-key" |
→ m () |
assertEqualModuloDesc file1 file2
loads file1
and file2
from disk,
then it strips the field description
from the loaded content, and finally compare
the two values. The values must be equal, otherwise the test is failed.
Required, because command "key" "verification-key"
generates keys without descriptions.
Note that it would be better to write descriptions, see:
https://github.com/IntersectMBO/cardano-cli/issues/429#issuecomment-2003880575
assertHasKeys ∷ HasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ [Text] → FilePath → m () Source #
assertHasKeys keys path
succeeds if path
is a file containing a JSON object
whose keys is a superset of keys
.
For example. if path
contains "{ "a":0, "b":1.0, "c": "foo"}"
,
hasKeys ["b", "a"] path
succeeds.
assertHasMappings ∷ HasCallStack ⇒ MonadTest m ⇒ MonadIO m ⇒ [(Text, Text)] → FilePath → m () Source #
assertHasMappings pairs path
succeeds if path
is a file containing a JSON object
whose mappings is a superset of pairs
.
For example, if path
contains "{ "a":"bar", "b":"buzz", "c":"foo"}"
,
assertHasMappings "[("b", "buzz"), ("a", "bar")] path
succeeds.