LGTM, thanks

On Mon, Mar 17, 2014 at 2:33 PM, Petr Pudlak <[email protected]> wrote:

> .. to test if `readJSON . showJSON = Ok`.
>
> Signed-off-by: Petr Pudlak <[email protected]>
> ---
>  test/hs/Test/Ganeti/Locking/Locks.hs | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/test/hs/Test/Ganeti/Locking/Locks.hs
> b/test/hs/Test/Ganeti/Locking/Locks.hs
> index 34aeb6d..efebe19 100644
> --- a/test/hs/Test/Ganeti/Locking/Locks.hs
> +++ b/test/hs/Test/Ganeti/Locking/Locks.hs
> @@ -28,13 +28,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor,
> Boston, MA
>
>  module Test.Ganeti.Locking.Locks (testLocking_Locks) where
>
> -import Control.Applicative ((<$>), liftA2)
> +import Control.Applicative ((<$>), (<*>), liftA2)
>
>  import Test.QuickCheck
>  import Text.JSON
>
>  import Test.Ganeti.TestHelper
>  import Test.Ganeti.TestCommon
> +import Test.Ganeti.Types ()
>
>  import Ganeti.Locking.Locks
>  import Ganeti.Locking.Types
> @@ -89,9 +90,18 @@ prop_ReadShowLevel :: Property
>  prop_ReadShowLevel = forAll (arbitrary :: Gen LockLevel) $ \a ->
>    readJSON (showJSON a) ==? Ok a
>
> +instance Arbitrary ClientId where
> +  arbitrary = ClientId <$> arbitrary <*> arbitrary <*> arbitrary
> +
> +-- | Verify that readJSON . showJSON = Ok for ClientId
> +prop_ReadShow_ClientId :: Property
> +prop_ReadShow_ClientId = forAll (arbitrary :: Gen ClientId) $ \a ->
> +  readJSON (showJSON a) ==? Ok a
> +
>  testSuite "Locking/Locks"
>   [ 'prop_ReadShow
>   , 'prop_ImpliedOrder
>   , 'prop_ImpliedIntervall
>   , 'prop_ReadShowLevel
> + , 'prop_ReadShow_ClientId
>   ]
> --
> 1.9.0.279.gdc9e3eb
>
>


-- 
-- 
Helga Velroyen | Software Engineer | [email protected] |

Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to