Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
garyb committed Mar 27, 2017
1 parent e8e0db5 commit a8089de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/Test/Data/Map.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (log, CONSOLE)
import Control.Monad.Eff.Exception (EXCEPTION)
import Control.Monad.Eff.Random (RANDOM)
import Data.NonEmpty ((:|))
import Data.Foldable (foldl, for_, all)
import Data.Function (on)
import Data.List (List(Cons), groupBy, length, nubBy, singleton, sort, sortBy)
Expand Down Expand Up @@ -40,7 +41,7 @@ instance showSmallKey :: Show SmallKey where
show J = "J"

instance arbSmallKey :: Arbitrary SmallKey where
arbitrary = elements A [B, C, D, E, F, G, H, I, J]
arbitrary = elements $ A :| [B, C, D, E, F, G, H, I, J]

data Instruction k v = Insert k v | Delete k

Expand All @@ -49,7 +50,7 @@ instance showInstruction :: (Show k, Show v) => Show (Instruction k v) where
show (Delete k) = "Delete (" <> show k <> ")"

instance arbInstruction :: (Arbitrary k, Arbitrary v) => Arbitrary (Instruction k v) where
arbitrary = oneOf (Insert <$> arbitrary <*> arbitrary) [Delete <$> arbitrary]
arbitrary = oneOf $ (Insert <$> arbitrary <*> arbitrary) :| [Delete <$> arbitrary]

runInstructions :: forall k v. Ord k => List (Instruction k v) -> M.Map k v -> M.Map k v
runInstructions instrs t0 = foldl step t0 instrs
Expand Down

0 comments on commit a8089de

Please sign in to comment.