2{-# LANGUAGE FlexibleContexts #-} -- For arbitrary Compose
3{-# LANGUAGE OverloadedStrings #-}
4{-# LANGUAGE RankNTypes #-}
5{-# LANGUAGE ScopedTypeVariables #-}
12import Control.Applicative (Const)
13import Data.Aeson (eitherDecode, encode)
14import Data.Aeson.Encoding (encodingToLazyByteString)
15import Data.Aeson.Internal (IResult(..), formatError, ifromJSON, iparse)
16import Data.Aeson.Parser (value)
17import Data.Aeson.Types
18import Data.DList (DList)
19import Data.Functor.Compose (Compose (..))
20import Data.HashMap.Strict (HashMap)
21import Data.Hashable (Hashable)
23import Data.List.NonEmpty (NonEmpty)
25import Data.Proxy (Proxy)
26import Data.Ratio (Ratio)
27import Data.Sequence (Seq)
28import Data.Tagged (Tagged)
29import Data.Time (Day, LocalTime, NominalDiffTime, TimeOfDay, UTCTime, ZonedTime)
30import Data.Version (Version)
33import Numeric.Natural (Natural)
34import Test.Framework (Test, testGroup)
35import Test.Framework.Providers.QuickCheck2 (testProperty)
36import Test.QuickCheck (Arbitrary(..), Property, (===), (.&&.), counterexample)
38import qualified Data.Attoparsec.Lazy as L
39import qualified Data.ByteString.Lazy.Char8 as L
40import qualified Data.HashMap.Strict as H
41import qualified Data.Map as Map
42import qualified Data.Text as T
43import qualified Data.Text.Lazy as LT
44import qualified Data.Vector as V
46encodeDouble :: Double -> Double -> Property
48 | isInfinite d || isNaN d = encode d === "null"
49 | otherwise = (read . L.unpack . encode) d === d
52encodeInteger :: Integer -> Property
53encodeInteger i = encode i === L.pack (show i)
55toParseJSON :: (Eq a, Show a) =>
56 (Value -> Parser a) -> (a -> Value) -> a -> Property
57toParseJSON parsejson tojson x =
58 case iparse parsejson . tojson $ x of
59 IError path msg -> failure "parse" (formatError path msg) x
60 ISuccess x' -> x === x'
63 :: (Eq (f Int), Show (f Int))
64 => (forall a. LiftParseJSON f a)
65 -> (forall a. LiftToJSON f a)
68toParseJSON1 parsejson1 tojson1 = toParseJSON parsejson tojson
70 parsejson = parsejson1 parseJSON (listParser parseJSON)
71 tojson = tojson1 toJSON (listValue toJSON)
73roundTripEnc :: (FromJSON a, ToJSON a, Show a) =>
74 (a -> a -> Property) -> a -> a -> Property
76 case fmap ifromJSON . L.parse value . encode $ i of
77 L.Done _ (ISuccess v) -> v `eq` i
78 L.Done _ (IError path err) -> failure "fromJSON" (formatError path err) i
79 L.Fail _ _ err -> failure "parse" err i
81roundTripNoEnc :: (FromJSON a, ToJSON a, Show a) =>
82 (a -> a -> Property) -> a -> a -> Property
83roundTripNoEnc eq _ i =
84 case ifromJSON . toJSON $ i of
85 (ISuccess v) -> v `eq` i
86 (IError path err) -> failure "fromJSON" (formatError path err) i
88roundTripEq :: (Eq a, FromJSON a, ToJSON a, Show a) => a -> a -> Property
89roundTripEq x y = roundTripEnc (===) x y .&&. roundTripNoEnc (===) x y
91-- We test keys by encoding HashMap and Map with it
93 :: (Ord a, Hashable a, FromJSONKey a, ToJSONKey a, Show a)
94 => a -> HashMap a Int -> Map a Int -> Property
95roundTripKey _ h m = roundTripEq h h .&&. roundTripEq m m
98(==~) :: (ApproxEq a, Show a) => a -> a -> Property
100 counterexample (show x ++ " /= " ++ show y) (x =~ y)
102toFromJSON :: (Arbitrary a, Eq a, FromJSON a, ToJSON a, Show a) => a -> Property
103toFromJSON x = case ifromJSON (toJSON x) of
104 IError path err -> failure "fromJSON" (formatError path err) x
105 ISuccess x' -> x === x'
107modifyFailureProp :: String -> String -> Bool
108modifyFailureProp orig added =
109 result == Error (added ++ orig)
111 parser = const $ modifyFailure (added ++) $ fail orig
113 result = parse parser ()
115-- | Perform a structural comparison of the results of two encoding
116-- methods. Compares decoded values to account for HashMap-driven
117-- variation in JSON object key ordering.
118sameAs :: (a -> Value) -> (a -> Encoding) -> a -> Property
119sameAs toVal toEnc v =
120 eitherDecode (encodingToLazyByteString (toEnc v)) === Right (toVal v)
123 :: (forall a. LiftToJSON f a)
124 -> (forall a. LiftToEncoding f a)
127sameAs1 toVal1 toEnc1 v = lhs === rhs
129 rhs = Right $ toVal1 toJSON (listValue toJSON) v
130 lhs = eitherDecode . encodingToLazyByteString $
131 toEnc1 toEncoding (listEncoding toEncoding) v
136 -> (forall b. LiftToEncoding f b)
139sameAs1Agree toEnc toEnc1 v = rhs === lhs
141 rhs = encodingToLazyByteString $ toEnc v
142 lhs = encodingToLazyByteString $ toEnc1 toEncoding (listEncoding toEncoding) v
144type P6 = Product6 Int Bool String (Approx Double) (Int, Approx Double) ()
145type S4 = Sum4 Int8 ZonedTime T.Text (Map.Map String Int)
147--------------------------------------------------------------------------------
149--------------------------------------------------------------------------------
151isString :: Value -> Bool
152isString (String _) = True
155is2ElemArray :: Value -> Bool
156is2ElemArray (Array v) = V.length v == 2 && isString (V.head v)
157is2ElemArray _ = False
159isTaggedObjectValue :: Value -> Bool
160isTaggedObjectValue (Object obj) = "tag" `H.member` obj &&
161 "contents" `H.member` obj
162isTaggedObjectValue _ = False
164isNullaryTaggedObject :: Value -> Bool
165isNullaryTaggedObject obj = isTaggedObject obj && isObjectWithSingleField obj
167isTaggedObject :: Value -> Bool
168isTaggedObject (Object obj) = "tag" `H.member` obj
169isTaggedObject _ = False
171isObjectWithSingleField :: Value -> Bool
172isObjectWithSingleField (Object obj) = H.size obj == 1
173isObjectWithSingleField _ = False
175-- | is untaggedValue of EitherTextInt
176isUntaggedValueETI :: Value -> Bool
177isUntaggedValueETI (String s)
178 | s == "nonenullary" = True
179isUntaggedValueETI (Bool _) = True
180isUntaggedValueETI (Number _) = True
181isUntaggedValueETI (Array a) = length a == 2
182isUntaggedValueETI _ = False
185--------------------------------------------------------------------------------
189tests = testGroup "properties" [
191 testProperty "encodeDouble" encodeDouble
192 , testProperty "encodeInteger" encodeInteger
194 , testGroup "roundTrip" [
195 testProperty "Bool" $ roundTripEq True
196 , testProperty "Double" $ roundTripEq (1 :: Approx Double)
197 , testProperty "Int" $ roundTripEq (1 :: Int)
198 , testProperty "NonEmpty Char" $ roundTripEq (undefined :: NonEmpty Char)
199 , testProperty "Integer" $ roundTripEq (1 :: Integer)
200 , testProperty "String" $ roundTripEq ("" :: String)
201 , testProperty "Text" $ roundTripEq T.empty
202 , testProperty "Lazy Text" $ roundTripEq LT.empty
203 , testProperty "Foo" $ roundTripEq (undefined :: Foo)
204 , testProperty "Day" $ roundTripEq (undefined :: Day)
205 , testProperty "DotNetTime" $ roundTripEq (undefined :: Approx DotNetTime)
206 , testProperty "LocalTime" $ roundTripEq (undefined :: LocalTime)
207 , testProperty "TimeOfDay" $ roundTripEq (undefined :: TimeOfDay)
208 , testProperty "UTCTime" $ roundTripEq (undefined :: UTCTime)
209 , testProperty "ZonedTime" $ roundTripEq (undefined :: ZonedTime)
210 , testProperty "NominalDiffTime" $ roundTripEq (undefined :: NominalDiffTime)
211 , testProperty "Version" $ roundTripEq (undefined :: Version)
212 , testProperty "Natural" $ roundTripEq (undefined :: Natural)
213 , testProperty "Proxy" $ roundTripEq (undefined :: Proxy Int)
214 , testProperty "Tagged" $ roundTripEq (undefined :: Tagged Int Char)
215 , testProperty "Const" $ roundTripEq (undefined :: Const Int Char)
216 , testProperty "DList" $ roundTripEq (undefined :: DList Int)
217 , testProperty "Seq" $ roundTripEq (undefined :: Seq Int)
218 , testProperty "Rational" $ roundTripEq (undefined :: Rational)
219 , testProperty "Ratio Int" $ roundTripEq (undefined :: Ratio Int)
220 , testGroup "functors"
221 [ testProperty "Identity Char" $ roundTripEq (undefined :: I Int)
223 , testProperty "Identity Char" $ roundTripEq (undefined :: I Char)
224 , testProperty "Identity [Char]" $ roundTripEq (undefined :: I [Char])
225 , testProperty "[Identity Char]" $ roundTripEq (undefined :: [I Char])
227 , testProperty "Compose I I Int" $ roundTripEq (undefined :: Compose I I Int)
228 , testProperty "Compose [] I Int" $ roundTripEq (undefined :: Compose [] I Int)
229 , testProperty "Compose I [] Int" $ roundTripEq (undefined :: Compose I [] Int)
230 , testProperty "Compose [] [] Int" $ roundTripEq (undefined :: Compose [] [] Int)
232 , testProperty "Compose I I Char" $ roundTripEq (undefined :: Compose I I Char)
233 , testProperty "Compose [] I Char" $ roundTripEq (undefined :: Compose [] I Char)
234 , testProperty "Compose I [] Char" $ roundTripEq (undefined :: Compose I [] Char)
235 , testProperty "Compose [] [] Char" $ roundTripEq (undefined :: Compose [] [] Char)
237 , testProperty "Compose3 I I I Char" $ roundTripEq (undefined :: Compose3 I I I Char)
238 , testProperty "Compose3 I [] I Char" $ roundTripEq (undefined :: Compose3 I [] I Char)
239 , testProperty "Compose3 I I [] Char" $ roundTripEq (undefined :: Compose3 I I [] Char)
240 , testProperty "Compose3 I [] [] Char" $ roundTripEq (undefined :: Compose3 I [] [] Char)
241 , testProperty "Compose3 [] I I Char" $ roundTripEq (undefined :: Compose3 [] I I Char)
242 , testProperty "Compose3 [] [] I Char" $ roundTripEq (undefined :: Compose3 [] [] I Char)
243 , testProperty "Compose3 [] I [] Char" $ roundTripEq (undefined :: Compose3 [] I [] Char)
244 , testProperty "Compose3 [] [] [] Char" $ roundTripEq (undefined :: Compose3 [] [] [] Char)
246 , testProperty "Compose3' I I I Char" $ roundTripEq (undefined :: Compose3' I I I Char)
247 , testProperty "Compose3' I [] I Char" $ roundTripEq (undefined :: Compose3' I [] I Char)
248 , testProperty "Compose3' I I [] Char" $ roundTripEq (undefined :: Compose3' I I [] Char)
249 , testProperty "Compose3' I [] [] Char" $ roundTripEq (undefined :: Compose3' I [] [] Char)
250 , testProperty "Compose3' [] I I Char" $ roundTripEq (undefined :: Compose3' [] I I Char)
251 , testProperty "Compose3' [] [] I Char" $ roundTripEq (undefined :: Compose3' [] [] I Char)
252 , testProperty "Compose3' [] I [] Char" $ roundTripEq (undefined :: Compose3' [] I [] Char)
253 , testProperty "Compose3' [] [] [] Char" $ roundTripEq (undefined :: Compose3' [] [] [] Char)
255 , testGroup "ghcGenerics" [
256 testProperty "OneConstructor" $ roundTripEq OneConstructor
257 , testProperty "Product2" $ roundTripEq (undefined :: Product2 Int Bool)
258 , testProperty "Product6" $ roundTripEq (undefined :: P6)
259 , testProperty "Sum4" $ roundTripEq (undefined :: S4)
262 , testGroup "roundTrip Key"
263 [ testProperty "Bool" $ roundTripKey True
264 , testProperty "Text" $ roundTripKey (undefined :: T.Text)
265 , testProperty "String" $ roundTripKey (undefined :: String)
266 , testProperty "Int" $ roundTripKey (undefined :: Int)
267 , testProperty "[Text]" $ roundTripKey (undefined :: [T.Text])
268 , testProperty "(Int,Char)" $ roundTripKey (undefined :: (Int,Char))
269 , testProperty "Integer" $ roundTripKey (undefined :: Integer)
270 , testProperty "Natural" $ roundTripKey (undefined :: Natural)
271 , testProperty "Float" $ roundTripKey (undefined :: Float)
272 , testProperty "Double" $ roundTripKey (undefined :: Double)
273#if MIN_VERSION_base(4,7,0)
274 , testProperty "Day" $ roundTripKey (undefined :: Day)
275 , testProperty "LocalTime" $ roundTripKey (undefined :: LocalTime)
276 , testProperty "TimeOfDay" $ roundTripKey (undefined :: TimeOfDay)
277 , testProperty "UTCTime" $ roundTripKey (undefined :: UTCTime)
279 , testProperty "Version" $ roundTripKey (undefined :: Version)
280 , testProperty "Lazy Text" $ roundTripKey (undefined :: LT.Text)
282 , testGroup "toFromJSON" [
283 testProperty "Integer" (toFromJSON :: Integer -> Property)
284 , testProperty "Double" (toFromJSON :: Double -> Property)
285 , testProperty "Maybe Integer" (toFromJSON :: Maybe Integer -> Property)
286 , testProperty "Either Integer Double" (toFromJSON :: Either Integer Double -> Property)
287 , testProperty "Either Integer Integer" (toFromJSON :: Either Integer Integer -> Property)
289 , testGroup "failure messages" [
290 testProperty "modify failure" modifyFailureProp
292 , testGroup "generic" [
294 testGroup "Nullary" [
295 testProperty "string" (isString . gNullaryToJSONString)
296 , testProperty "2ElemArray" (is2ElemArray . gNullaryToJSON2ElemArray)
297 , testProperty "TaggedObject" (isNullaryTaggedObject . gNullaryToJSONTaggedObject)
298 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . gNullaryToJSONObjectWithSingleField)
299 , testGroup "roundTrip" [
300 testProperty "string" (toParseJSON gNullaryParseJSONString gNullaryToJSONString)
301 , testProperty "2ElemArray" (toParseJSON gNullaryParseJSON2ElemArray gNullaryToJSON2ElemArray)
302 , testProperty "TaggedObject" (toParseJSON gNullaryParseJSONTaggedObject gNullaryToJSONTaggedObject)
303 , testProperty "ObjectWithSingleField" (toParseJSON gNullaryParseJSONObjectWithSingleField gNullaryToJSONObjectWithSingleField)
306 , testGroup "EitherTextInt" [
307 testProperty "UntaggedValue" (isUntaggedValueETI . gEitherTextIntToJSONUntaggedValue)
308 , testProperty "roundtrip" (toParseJSON gEitherTextIntParseJSONUntaggedValue gEitherTextIntToJSONUntaggedValue)
310 , testGroup "SomeType" [
311 testProperty "2ElemArray" (is2ElemArray . gSomeTypeToJSON2ElemArray)
312 , testProperty "TaggedObject" (isTaggedObject . gSomeTypeToJSONTaggedObject)
313 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . gSomeTypeToJSONObjectWithSingleField)
314 , testGroup "roundTrip" [
315 testProperty "2ElemArray" (toParseJSON gSomeTypeParseJSON2ElemArray gSomeTypeToJSON2ElemArray)
316 , testProperty "TaggedObject" (toParseJSON gSomeTypeParseJSONTaggedObject gSomeTypeToJSONTaggedObject)
317 , testProperty "ObjectWithSingleField" (toParseJSON gSomeTypeParseJSONObjectWithSingleField gSomeTypeToJSONObjectWithSingleField)
319#if __GLASGOW_HASKELL__ >= 706
320 , testProperty "2ElemArray unary" (toParseJSON1 gSomeTypeLiftParseJSON2ElemArray gSomeTypeLiftToJSON2ElemArray)
321 , testProperty "TaggedObject unary" (toParseJSON1 gSomeTypeLiftParseJSONTaggedObject gSomeTypeLiftToJSONTaggedObject)
322 , testProperty "ObjectWithSingleField unary" (toParseJSON1 gSomeTypeLiftParseJSONObjectWithSingleField gSomeTypeLiftToJSONObjectWithSingleField)
327 , testGroup "toEncoding" [
328 testProperty "NullaryString" $
329 gNullaryToJSONString `sameAs` gNullaryToEncodingString
330 , testProperty "Nullary2ElemArray" $
331 gNullaryToJSON2ElemArray `sameAs` gNullaryToEncoding2ElemArray
332 , testProperty "NullaryTaggedObject" $
333 gNullaryToJSONTaggedObject `sameAs` gNullaryToEncodingTaggedObject
334 , testProperty "NullaryObjectWithSingleField" $
335 gNullaryToJSONObjectWithSingleField `sameAs`
336 gNullaryToEncodingObjectWithSingleField
337 -- , testProperty "ApproxUnwrap" $
338 -- gApproxToJSONUnwrap `sameAs` gApproxToEncodingUnwrap
339 , testProperty "ApproxDefault" $
340 gApproxToJSONDefault `sameAs` gApproxToEncodingDefault
342 , testProperty "EitherTextInt UntaggedValue" $
343 gEitherTextIntToJSONUntaggedValue `sameAs` gEitherTextIntToEncodingUntaggedValue
345 , testProperty "SomeType2ElemArray" $
346 gSomeTypeToJSON2ElemArray `sameAs` gSomeTypeToEncoding2ElemArray
347#if __GLASGOW_HASKELL__ >= 706
348 , testProperty "SomeType2ElemArray unary" $
349 gSomeTypeLiftToJSON2ElemArray `sameAs1` gSomeTypeLiftToEncoding2ElemArray
350 , testProperty "SomeType2ElemArray unary agree" $
351 gSomeTypeToEncoding2ElemArray `sameAs1Agree` gSomeTypeLiftToEncoding2ElemArray
354 , testProperty "SomeTypeTaggedObject" $
355 gSomeTypeToJSONTaggedObject `sameAs` gSomeTypeToEncodingTaggedObject
356#if __GLASGOW_HASKELL__ >= 706
357 , testProperty "SomeTypeTaggedObject unary" $
358 gSomeTypeLiftToJSONTaggedObject `sameAs1` gSomeTypeLiftToEncodingTaggedObject
359 , testProperty "SomeTypeTaggedObject unary agree" $
360 gSomeTypeToEncodingTaggedObject `sameAs1Agree` gSomeTypeLiftToEncodingTaggedObject
363 , testProperty "SomeTypeObjectWithSingleField" $
364 gSomeTypeToJSONObjectWithSingleField `sameAs` gSomeTypeToEncodingObjectWithSingleField
365#if __GLASGOW_HASKELL__ >= 706
366 , testProperty "SomeTypeObjectWithSingleField unary" $
367 gSomeTypeLiftToJSONObjectWithSingleField `sameAs1` gSomeTypeLiftToEncodingObjectWithSingleField
368 , testProperty "SomeTypeObjectWithSingleField unary agree" $
369 gSomeTypeToEncodingObjectWithSingleField `sameAs1Agree` gSomeTypeLiftToEncodingObjectWithSingleField
372 , testProperty "SomeTypeOmitNothingFields" $
373 gSomeTypeToJSONOmitNothingFields `sameAs` gSomeTypeToEncodingOmitNothingFields
376 , testGroup "template-haskell" [
378 testGroup "Nullary" [
379 testProperty "string" (isString . thNullaryToJSONString)
380 , testProperty "2ElemArray" (is2ElemArray . thNullaryToJSON2ElemArray)
381 , testProperty "TaggedObject" (isNullaryTaggedObject . thNullaryToJSONTaggedObject)
382 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thNullaryToJSONObjectWithSingleField)
384 , testGroup "roundTrip" [
385 testProperty "string" (toParseJSON thNullaryParseJSONString thNullaryToJSONString)
386 , testProperty "2ElemArray" (toParseJSON thNullaryParseJSON2ElemArray thNullaryToJSON2ElemArray)
387 , testProperty "TaggedObject" (toParseJSON thNullaryParseJSONTaggedObject thNullaryToJSONTaggedObject)
388 , testProperty "ObjectWithSingleField" (toParseJSON thNullaryParseJSONObjectWithSingleField thNullaryToJSONObjectWithSingleField)
391 , testGroup "EitherTextInt" [
392 testProperty "UntaggedValue" (isUntaggedValueETI . thEitherTextIntToJSONUntaggedValue)
393 , testProperty "roundtrip" (toParseJSON thEitherTextIntParseJSONUntaggedValue thEitherTextIntToJSONUntaggedValue)
395 , testGroup "SomeType" [
396 testProperty "2ElemArray" (is2ElemArray . thSomeTypeToJSON2ElemArray)
397 , testProperty "TaggedObject" (isTaggedObject . thSomeTypeToJSONTaggedObject)
398 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thSomeTypeToJSONObjectWithSingleField)
399 , testGroup "roundTrip" [
400 testProperty "2ElemArray" (toParseJSON thSomeTypeParseJSON2ElemArray thSomeTypeToJSON2ElemArray)
401 , testProperty "TaggedObject" (toParseJSON thSomeTypeParseJSONTaggedObject thSomeTypeToJSONTaggedObject)
402 , testProperty "ObjectWithSingleField" (toParseJSON thSomeTypeParseJSONObjectWithSingleField thSomeTypeToJSONObjectWithSingleField)
404 , testProperty "2ElemArray unary" (toParseJSON1 thSomeTypeLiftParseJSON2ElemArray thSomeTypeLiftToJSON2ElemArray)
405 , testProperty "TaggedObject unary" (toParseJSON1 thSomeTypeLiftParseJSONTaggedObject thSomeTypeLiftToJSONTaggedObject)
406 , testProperty "ObjectWithSingleField unary" (toParseJSON1 thSomeTypeLiftParseJSONObjectWithSingleField thSomeTypeLiftToJSONObjectWithSingleField)
409 , testGroup "Approx" [
410 testProperty "string" (isString . thApproxToJSONUnwrap)
411 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thApproxToJSONDefault)
412 , testGroup "roundTrip" [
413 testProperty "string" (toParseJSON thApproxParseJSONUnwrap thApproxToJSONUnwrap)
414 , testProperty "ObjectWithSingleField" (toParseJSON thApproxParseJSONDefault thApproxToJSONDefault)
418 testProperty "string" (isString . thGADTToJSONUnwrap)
419 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thGADTToJSONDefault)
420 , testGroup "roundTrip" [
421 testProperty "string" (toParseJSON thGADTParseJSONUnwrap thGADTToJSONUnwrap)
422 , testProperty "ObjectWithSingleField" (toParseJSON thGADTParseJSONDefault thGADTToJSONDefault)
427 , testGroup "toEncoding" [
428 testProperty "NullaryString" $
429 thNullaryToJSONString `sameAs` thNullaryToEncodingString
430 , testProperty "Nullary2ElemArray" $
431 thNullaryToJSON2ElemArray `sameAs` thNullaryToEncoding2ElemArray
432 , testProperty "NullaryTaggedObject" $
433 thNullaryToJSONTaggedObject `sameAs` thNullaryToEncodingTaggedObject
434 , testProperty "NullaryObjectWithSingleField" $
435 thNullaryToJSONObjectWithSingleField `sameAs`
436 thNullaryToEncodingObjectWithSingleField
437 , testProperty "ApproxUnwrap" $
438 thApproxToJSONUnwrap `sameAs` thApproxToEncodingUnwrap
439 , testProperty "ApproxDefault" $
440 thApproxToJSONDefault `sameAs` thApproxToEncodingDefault
442 , testProperty "EitherTextInt UntaggedValue" $
443 thEitherTextIntToJSONUntaggedValue `sameAs` thEitherTextIntToEncodingUntaggedValue
445 , testProperty "SomeType2ElemArray" $
446 thSomeTypeToJSON2ElemArray `sameAs` thSomeTypeToEncoding2ElemArray
447 , testProperty "SomeType2ElemArray unary" $
448 thSomeTypeLiftToJSON2ElemArray `sameAs1` thSomeTypeLiftToEncoding2ElemArray
449 , testProperty "SomeType2ElemArray unary agree" $
450 thSomeTypeToEncoding2ElemArray `sameAs1Agree` thSomeTypeLiftToEncoding2ElemArray
452 , testProperty "SomeTypeTaggedObject" $
453 thSomeTypeToJSONTaggedObject `sameAs` thSomeTypeToEncodingTaggedObject
454 , testProperty "SomeTypeTaggedObject unary" $
455 thSomeTypeLiftToJSONTaggedObject `sameAs1` thSomeTypeLiftToEncodingTaggedObject
456 , testProperty "SomeTypeTaggedObject unary agree" $
457 thSomeTypeToEncodingTaggedObject `sameAs1Agree` thSomeTypeLiftToEncodingTaggedObject
459 , testProperty "SomeTypeObjectWithSingleField" $
460 thSomeTypeToJSONObjectWithSingleField `sameAs` thSomeTypeToEncodingObjectWithSingleField
461 , testProperty "SomeTypeObjectWithSingleField unary" $
462 thSomeTypeLiftToJSONObjectWithSingleField `sameAs1` thSomeTypeLiftToEncodingObjectWithSingleField
463 , testProperty "SomeTypeObjectWithSingleField unary agree" $
464 thSomeTypeToEncodingObjectWithSingleField `sameAs1Agree` thSomeTypeLiftToEncodingObjectWithSingleField
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list