@@ -1,16 +1,19 @@
11{-# LANGUAGE DeriveAnyClass #-}
22{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE OverloadedStrings #-}
34{-# LANGUAGE ScopedTypeVariables #-}
45{-# OPTIONS_GHC -fno-warn-orphans #-}
56module Web.HttpApiData.Internal.TestInstances
67 ( RandomCase(..)
78 , SimpleRec(..)
89 , SimpleSumRec(..)
10+ , NoEmptyKeyForm(..)
911 ) where
1012
1113import Control.Applicative
1214import qualified Data.ByteString.Lazy.Char8 as BSL
1315import Data.Char
16+import qualified Data.Map as M
1417import qualified Data.Text as T
1518import qualified Data.Text.Lazy as L
1619import Data.Time
@@ -104,3 +107,10 @@ instance Arbitrary SimpleSumRec where
104107 [ SSRLeft <$> arbitrary <*> arbitrary
105108 , SSRRight <$> arbitrary <*> arbitrary
106109 ]
110+
111+newtype NoEmptyKeyForm =
112+ NoEmptyKeyForm { unNoEmptyKeyForm :: Form }
113+ deriving Show
114+
115+instance Arbitrary NoEmptyKeyForm where
116+ arbitrary = NoEmptyKeyForm . Form . M.delete "" <$> arbitrary