fix(test): add arbitrart instances and adjust argument changes to tests
This commit is contained in:
parent
f6b87a09b0
commit
452cdf4442
@ -1,4 +1,4 @@
|
|||||||
-- SPDX-FileCopyrightText: 2022-23 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>,Steffen Jost <s.jost@fraport.de>
|
-- SPDX-FileCopyrightText: 2022-24 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>,Steffen Jost <s.jost@fraport.de>
|
||||||
--
|
--
|
||||||
-- SPDX-License-Identifier: AGPL-3.0-or-later
|
-- SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ spec = withApp . describe "Submission distribution" $ do
|
|||||||
void . insert $ Tutor tutId sheetCorrectorUser
|
void . insert $ Tutor tutId sheetCorrectorUser
|
||||||
E.insertSelect . E.from $ \submissionUser -> do
|
E.insertSelect . E.from $ \submissionUser -> do
|
||||||
E.where_ $ submissionUser E.^. SubmissionUserSubmission E.==. E.val subId
|
E.where_ $ submissionUser E.^. SubmissionUserSubmission E.==. E.val subId
|
||||||
return $ TutorialParticipant E.<# E.val tutId E.<&> (submissionUser E.^. SubmissionUserUser)
|
return $ TutorialParticipant E.<# E.val tutId E.<&> (submissionUser E.^. SubmissionUserUser) E.<&> E.nothing
|
||||||
)
|
)
|
||||||
(\result -> do
|
(\result -> do
|
||||||
let countResult = Map.map Set.size result
|
let countResult = Map.map Set.size result
|
||||||
|
|||||||
@ -318,7 +318,7 @@ instance Arbitrary CsvOptions where
|
|||||||
arbitrary = CsvOptions
|
arbitrary = CsvOptions
|
||||||
<$> arbitrary
|
<$> arbitrary
|
||||||
<*> arbitrary
|
<*> arbitrary
|
||||||
<*> suchThat arbitrary (maybe True $ not . elem (Char.chr 0))
|
<*> suchThat arbitrary (maybe True $ notElem (Char.chr 0))
|
||||||
shrink = genericShrink
|
shrink = genericShrink
|
||||||
|
|
||||||
instance Arbitrary CsvPreset where
|
instance Arbitrary CsvPreset where
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
@ -41,6 +41,8 @@ import System.IO.Unsafe (unsafePerformIO)
|
|||||||
import Data.Universe
|
import Data.Universe
|
||||||
|
|
||||||
|
|
||||||
|
deriving newtype instance Arbitrary a => Arbitrary (JSONB a)
|
||||||
|
|
||||||
instance Arbitrary EmailAddress where
|
instance Arbitrary EmailAddress where
|
||||||
arbitrary = do
|
arbitrary = do
|
||||||
local <- suchThat (CBS.pack . getPrintableString <$> arbitrary) (\l -> isEmail l (CBS.pack "example.com"))
|
local <- suchThat (CBS.pack . getPrintableString <$> arbitrary) (\l -> isEmail l (CBS.pack "example.com"))
|
||||||
@ -86,7 +88,6 @@ instance Arbitrary Tutorial where
|
|||||||
<*> (fmap getPositive <$> arbitrary)
|
<*> (fmap getPositive <$> arbitrary)
|
||||||
<*> arbitrary
|
<*> arbitrary
|
||||||
<*> arbitrary
|
<*> arbitrary
|
||||||
<*> arbitrary
|
|
||||||
<*> (fmap (CI.mk . pack . getPrintableString) <$> arbitrary)
|
<*> (fmap (CI.mk . pack . getPrintableString) <$> arbitrary)
|
||||||
<*> arbitrary
|
<*> arbitrary
|
||||||
<*> arbitrary
|
<*> arbitrary
|
||||||
|
|||||||
Reference in New Issue
Block a user