keiro-dsl-0.21.0.0: test/conformance-history-dependent-holes/Generated/HistoryDependentHoles/StructuralConformance.hs
-- @generated by keiro-dsl 0.21.0.0 (language keiro-dsl 6) from context history-dependent-holes structural conformance; do not edit.
module Generated.HistoryDependentHoles.StructuralConformance
( structuralConformanceAssertions
) where
import Data.Aeson qualified as Aeson
import Data.List (nub)
import Data.List.NonEmpty qualified as NonEmpty
import Data.Text qualified as T
import Keiro.Codec.Structural (FixtureCases (..))
import Conformance.HistoryDependentHoles.Bindings qualified as Bindings
structuralConformanceAssertions :: [(String, Bool)]
structuralConformanceAssertions =
concat
[ propertyValuesOpaqueAssertions
]
validFixtureLabels :: NonEmpty.NonEmpty (T.Text, value) -> Bool
validFixtureLabels cases =
all (not . T.null) labels && length labels == length (nub labels)
where
labels = map fst (NonEmpty.toList cases)
propertyValuesOpaqueAssertions :: [(String, Bool)]
propertyValuesOpaqueAssertions =
("opaque boundary fixtures: conformance.history-dependent-holes.PropertyValues.json@1", validFixtureLabels cases) :
[ ("opaque codec round-trip: conformance.history-dependent-holes.PropertyValues.json@1/" <> T.unpack caseLabel, case Aeson.fromJSON (Aeson.toJSON value) of Aeson.Success decoded -> decoded == value; Aeson.Error _ -> False)
| (caseLabel, value) <- NonEmpty.toList cases
]
where
cases = fixtureCases Bindings.propertyValuesCases