fix(build): occurrences no longer have a READ instance
This commit is contained in:
parent
8ddf38b904
commit
c9ecb30542
@ -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
|
-- SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
@ -66,8 +66,8 @@ instance Arbitrary Day where
|
|||||||
shrink day = let
|
shrink day = let
|
||||||
(y, m, d) = toGregorian day
|
(y, m, d) = toGregorian day
|
||||||
dayShrink = [fromGregorian y m (d - 1) | d > 1]
|
dayShrink = [fromGregorian y m (d - 1) | d > 1]
|
||||||
monthShrink = [fromGregorian y (m - 1) d | m > 1]
|
monthShrink = [fromGregorian y (m - 1) d | m > 1]
|
||||||
yearShrink = [fromGregorian (y - 1) m d | y > 2000]
|
yearShrink = [fromGregorian (y - 1) m d | y > 2000]
|
||||||
in dayShrink ++ monthShrink ++ yearShrink
|
in dayShrink ++ monthShrink ++ yearShrink
|
||||||
|
|
||||||
instance CoArbitrary Day where
|
instance CoArbitrary Day where
|
||||||
@ -75,7 +75,7 @@ instance CoArbitrary Day where
|
|||||||
-}
|
-}
|
||||||
|
|
||||||
instance Arbitrary TermIdentifier where
|
instance Arbitrary TermIdentifier where
|
||||||
arbitrary = TermIdentifier <$> arbitrary
|
arbitrary = TermIdentifier <$> arbitrary
|
||||||
shrink = fmap TermIdentifier . shrink . year
|
shrink = fmap TermIdentifier . shrink . year
|
||||||
instance CoArbitrary TermIdentifier
|
instance CoArbitrary TermIdentifier
|
||||||
instance Function TermIdentifier
|
instance Function TermIdentifier
|
||||||
@ -399,7 +399,7 @@ instance Arbitrary UploadNonce where
|
|||||||
|
|
||||||
instance Arbitrary SchoolAuthorshipStatementMode where
|
instance Arbitrary SchoolAuthorshipStatementMode where
|
||||||
arbitrary = genericArbitrary
|
arbitrary = genericArbitrary
|
||||||
|
|
||||||
instance Arbitrary SheetAuthorshipStatementMode where
|
instance Arbitrary SheetAuthorshipStatementMode where
|
||||||
arbitrary = genericArbitrary
|
arbitrary = genericArbitrary
|
||||||
|
|
||||||
@ -455,7 +455,7 @@ spec = do
|
|||||||
lawsCheckHspec (Proxy @TermIdentifier)
|
lawsCheckHspec (Proxy @TermIdentifier)
|
||||||
[ eqLaws, showReadLaws, ordLaws, enumLaws, persistFieldLaws, jsonLaws, httpApiDataLaws, pathPieceLaws ]
|
[ eqLaws, showReadLaws, ordLaws, enumLaws, persistFieldLaws, jsonLaws, httpApiDataLaws, pathPieceLaws ]
|
||||||
lawsCheckHspec (Proxy @Occurrences)
|
lawsCheckHspec (Proxy @Occurrences)
|
||||||
[ eqLaws, showReadLaws, ordLaws, jsonLaws, persistFieldLaws ]
|
[ eqLaws, ordLaws, jsonLaws, persistFieldLaws ]
|
||||||
lawsCheckHspec (Proxy @StudyFieldType)
|
lawsCheckHspec (Proxy @StudyFieldType)
|
||||||
[ eqLaws, ordLaws, boundedEnumLaws, showReadLaws, persistFieldLaws ]
|
[ eqLaws, ordLaws, boundedEnumLaws, showReadLaws, persistFieldLaws ]
|
||||||
lawsCheckHspec (Proxy @Theme)
|
lawsCheckHspec (Proxy @Theme)
|
||||||
@ -541,11 +541,11 @@ spec = do
|
|||||||
|
|
||||||
describe "TermIdentifier" $ do
|
describe "TermIdentifier" $ do
|
||||||
it "has compatible encoding/decoding to/from Text" . property $
|
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 $
|
it "has compatible encoding/decoding to/from Rational" . property $
|
||||||
\term -> termFromRational (termToRational term) == term
|
\term -> termFromRational (termToRational term) == term
|
||||||
-- This is not sufficient
|
-- 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
|
-- \term -> fromPersistValue (toPersistValue term) == term
|
||||||
it "has human readable year encoding to Rational" . property $
|
it "has human readable year encoding to Rational" . property $
|
||||||
\term -> truncate (termToRational term) == year term
|
\term -> truncate (termToRational term) == year term
|
||||||
|
|||||||
Reference in New Issue
Block a user