Skip to content

Instantly share code, notes, and snippets.

@mjhoy
Created September 11, 2017 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjhoy/c4af83e6fc96f6e2a6cbca224e068fda to your computer and use it in GitHub Desktop.
Save mjhoy/c4af83e6fc96f6e2a6cbca224e068fda to your computer and use it in GitHub Desktop.
mapSpec = do
describe "foo" $ do
it "should be foo" $ do
let m = insert "duration" "4" $
insert "durationUnit" "Hour(s)" $
insert "lat" "44.97" $
insert "lng" "-93.265" $
insert "loc" "Minneapolis" $
insert "sortBy" "cheapest" Map.empty
m1 = Map.fromFoldable (Map.toUnfoldable m :: Array (Tuple String String))
Map.lookup "lat" m1 `shouldEqual` Just "44.97" -- OK
Map.lookup "lng" m1 `shouldEqual` Just "-93.265" -- fails: Nothing ≠ (Just "-93.265")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment