Permalink
Browse files

Typoe fix, add test for mapCollection

  • Loading branch information...
1 parent 1d51686 commit d3316292b31096050f14676f373ad45ff711ae56 @jaspervdj jaspervdj committed Aug 13, 2012
Showing with 10 additions and 1 deletion.
  1. +1 −1 FRP/Euphoria/Collection.hs
  2. +9 −0 tests/Test/Collection.hs
@@ -108,7 +108,7 @@ mapCollectionWithKey f aC = do
newUpdateE <- memoE $ fmap fcu updateE
makeCollection newCurD newUpdateE
where
- -- f applied to tupples and collection updates
+ -- f applied to tuples and collection updates
ft (k, x) = (k, f k x)
fcu (AddItem k x) = AddItem k (f k x)
fcu (RemoveItem k) = RemoveItem k
@@ -38,3 +38,12 @@ case_switchCollection = do
]
where
mkD list = signalToDiscrete <$> signalFromList list
+
+case_mapCollection :: Assertion
+case_mapCollection = do
+ result <- networkToList 1 $ do
+ col <- mapCollection show $
+ collectionFromList [(0 :: Int, 1 :: Int), (1, 2), (2, 3)]
+ discreteToSignal $ collectionToDiscreteList col
+
+ result @?= [[(0, "1"), (1, "2"), (2, "3")]]

0 comments on commit d331629

Please sign in to comment.