{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} -- Module : Test.AWS.Data.Map -- Copyright : (c) 2013-2015 Brendan Hay -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- you can obtain it at http://mozilla.org/MPL/2.0/. -- Maintainer : Brendan Hay -- Stability : experimental -- Portability : non-portable (GHC extensions) module Test.AWS.Data.Map (tests) where import GHC.Exts import Network.AWS.Prelude import Test.AWS.TH import Test.AWS.Types import Test.Tasty import Test.Tasty.HUnit tests :: TestTree tests = testGroup "map" [ testGroup "deserialise xml" [ testCase "entries" $ assertXML unflattened (Entries entries) , testCase "flattened" $ assertXML flattened entries ] ] entries :: EMap "entry" "key" "value" Text Text entries = fromList [ ("foo", "828ef3fdfa96f00ad9f27c383fc9ac7") , ("bar", "fe3f123jfa96f00ad9f27c383fc9sd1") , ("baz", "e50e9ce187d0a3a62f2ac0a5d89bf0a") ] unflattened :: LazyByteString unflattened = [doc| N baz e50e9ce187d0a3a62f2ac0a5d89bf0a foo 828ef3fdfa96f00ad9f27c383fc9ac7 bar fe3f123jfa96f00ad9f27c383fc9sd1 test |] flattened :: LazyByteString flattened = [doc| foo N foo 828ef3fdfa96f00ad9f27c383fc9ac7 bar fe3f123jfa96f00ad9f27c383fc9sd1 baz e50e9ce187d0a3a62f2ac0a5d89bf0a Ned |]