keiro-dsl-0.21.0.0: test/conformance-service-package/runtime/src/Proof/WorkspaceProof/Generated/StructuralConformance.hs
-- @generated by keiro-dsl 0.21.0.0 (language keiro-dsl 4) from context workspace-proof structural conformance; do not edit.
module Proof.WorkspaceProof.Generated.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 Proof.WorkspaceProof.AssignmentSupport qualified as AssignmentSupport
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 AssignmentSupport.propertyValuesCases