fix(build): occurrences no longer have a READ instance

This commit is contained in:
Steffen Jost 2024-10-04 16:16:32 +02:00
parent 8ddf38b904
commit c9ecb30542

View File

@ -1,4 +1,4 @@
-- SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Steffen Jost <jost@cip.ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>
-- SPDX-FileCopyrightText: 2022-24 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Steffen Jost <jost@cip.ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Steffen Jost <s.jost@fraport.de>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later
@ -66,8 +66,8 @@ instance Arbitrary Day where
shrink day = let
(y, m, d) = toGregorian day
dayShrink = [fromGregorian y m (d - 1) | d > 1]
monthShrink = [fromGregorian y (m - 1) d | m > 1]
yearShrink = [fromGregorian (y - 1) m d | y > 2000]
monthShrink = [fromGregorian y (m - 1) d | m > 1]
yearShrink = [fromGregorian (y - 1) m d | y > 2000]
in dayShrink ++ monthShrink ++ yearShrink
instance CoArbitrary Day where
@ -75,7 +75,7 @@ instance CoArbitrary Day where
-}
instance Arbitrary TermIdentifier where
arbitrary = TermIdentifier <$> arbitrary
arbitrary = TermIdentifier <$> arbitrary
shrink = fmap TermIdentifier . shrink . year
instance CoArbitrary TermIdentifier
instance Function TermIdentifier
@ -399,7 +399,7 @@ instance Arbitrary UploadNonce where
instance Arbitrary SchoolAuthorshipStatementMode where
arbitrary = genericArbitrary
instance Arbitrary SheetAuthorshipStatementMode where
arbitrary = genericArbitrary
@ -455,7 +455,7 @@ spec = do
lawsCheckHspec (Proxy @TermIdentifier)
[ eqLaws, showReadLaws, ordLaws, enumLaws, persistFieldLaws, jsonLaws, httpApiDataLaws, pathPieceLaws ]
lawsCheckHspec (Proxy @Occurrences)
[ eqLaws, showReadLaws, ordLaws, jsonLaws, persistFieldLaws ]
[ eqLaws, ordLaws, jsonLaws, persistFieldLaws ]
lawsCheckHspec (Proxy @StudyFieldType)
[ eqLaws, ordLaws, boundedEnumLaws, showReadLaws, persistFieldLaws ]
lawsCheckHspec (Proxy @Theme)
@ -541,11 +541,11 @@ spec = do
describe "TermIdentifier" $ do
it "has compatible encoding/decoding to/from Text" . property $
\term -> termFromText (termToText term) == Right term
\term -> termFromText (termToText term) == Right term
it "has compatible encoding/decoding to/from Rational" . property $
\term -> termFromRational (termToRational term) == term
-- This is not sufficient
--it "has compatible encoding/decoding to/from PersistValue" . property $
--it "has compatible encoding/decoding to/from PersistValue" . property $
-- \term -> fromPersistValue (toPersistValue term) == term
it "has human readable year encoding to Rational" . property $
\term -> truncate (termToRational term) == year term