Commit d32fe318 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Verify readJSON . showJSON = Ok for ClientType



Verify that the JSON encoding of the ClientType can correctly
be decoded.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 79a25c7b
......@@ -90,6 +90,16 @@ prop_ReadShowLevel :: Property
prop_ReadShowLevel = forAll (arbitrary :: Gen LockLevel) $ \a ->
readJSON (showJSON a) ==? Ok a
instance Arbitrary ClientType where
arbitrary = oneof [ ClientOther <$> arbitrary
, ClientJob <$> arbitrary
]
-- | Verify that readJSON . showJSON = Ok for ClientType
prop_ReadShow_ClientType :: Property
prop_ReadShow_ClientType = forAll (arbitrary :: Gen ClientType) $ \a ->
readJSON (showJSON a) ==? Ok a
instance Arbitrary ClientId where
arbitrary = ClientId <$> arbitrary <*> arbitrary
......@@ -103,5 +113,6 @@ testSuite "Locking/Locks"
, 'prop_ImpliedOrder
, 'prop_ImpliedIntervall
, 'prop_ReadShowLevel
, 'prop_ReadShow_ClientType
, 'prop_ReadShow_ClientId
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment