2021-02-13 06:56:10 +01:00
|
|
|
{- This Source Code Form is subject to the terms of the Mozilla Public License,
|
|
|
|
v. 2.0. If a copy of the MPL was not distributed with this file, You can
|
|
|
|
obtain one at https://mozilla.org/MPL/2.0/. -}
|
|
|
|
|
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
2021-02-14 14:46:06 +01:00
|
|
|
|
2021-02-13 06:56:10 +01:00
|
|
|
module Language.GraphQL.Execute.OrderedMapSpec
|
|
|
|
( spec
|
|
|
|
) where
|
|
|
|
|
|
|
|
import Language.GraphQL.Execute.OrderedMap (OrderedMap)
|
2021-02-14 14:46:06 +01:00
|
|
|
import qualified Language.GraphQL.Execute.OrderedMap as OrderedMap
|
|
|
|
import Test.Hspec (Spec, describe, it, shouldBe, shouldSatisfy)
|
2021-02-13 06:56:10 +01:00
|
|
|
|
|
|
|
spec :: Spec
|
|
|
|
spec =
|
2021-02-14 14:46:06 +01:00
|
|
|
describe "OrderedMap" $ do
|
2021-02-13 06:56:10 +01:00
|
|
|
it "creates an empty map" $
|
2021-02-14 14:46:06 +01:00
|
|
|
(mempty :: OrderedMap String) `shouldSatisfy` null
|
|
|
|
|
|
|
|
it "creates a singleton" $
|
|
|
|
let value :: String
|
|
|
|
value = "value"
|
|
|
|
in OrderedMap.size (OrderedMap.singleton "key" value) `shouldBe` 1
|