Skip to content

Commit

Permalink
yampa-test: Move test for consistency with module tested. Refs #267.
Browse files Browse the repository at this point in the history
A prior commit moved the function FRP.Yampa.Event.maybeToEvent within
its module to a location that made more sense in terms of explaining the
API.

This commit moves the accompanying test in yampa-test, so that the test
module remains consistent with the module it tests.
  • Loading branch information
ivanperez-keera committed Oct 7, 2023
1 parent b18a942 commit 5a12bd1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions yampa-test/tests/Test/FRP/Yampa/Event.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ tests = testGroup "Regression tests for FRP.Yampa.Event"
, testApplicative
, testMonad
, testAlternative
, testProperty "maybeToEvent" testMaybeToEvent
, testEvent
, testProperty "fromEvent" testFromEvent
, testProperty "isEvent" testIsEvent
Expand All @@ -58,6 +57,7 @@ tests = testGroup "Regression tests for FRP.Yampa.Event"
, testProperty "filterE" testFilterE
, testProperty "mapFilterE" testMapFilterE
, testProperty "gate" testGate
, testProperty "maybeToEvent" testMaybeToEvent
]

-- * The Event type
Expand Down Expand Up @@ -227,14 +227,6 @@ testAlternative = testGroup "alternative"
testAlternativeEmptyIdRight =
forAll randomEvent $ \e ->
(e <|> noEvent ) == e

-- * Internal utilities for event construction

-- | maybeToEvent
testMaybeToEvent :: Property
testMaybeToEvent =
forAll randomMaybe $ \m ->
event Nothing Just (maybeToEvent m) == m
-- * Utility functions similar to those available for Maybe

-- | event
Expand Down Expand Up @@ -438,6 +430,14 @@ testGate =
forAll randomBool $ \b ->
gate e b == filterE (const b) e

-- * Utilities for easy event construction

-- | maybeToEvent
testMaybeToEvent :: Property
testMaybeToEvent =
forAll randomMaybe $ \m ->
event Nothing Just (maybeToEvent m) == m

-- * Arbitrary value generation

instance Arbitrary a => Arbitrary (Event a) where
Expand Down

0 comments on commit 5a12bd1

Please sign in to comment.