On Fri, Jul 04, 2014 at 06:48:44PM +0200, 'Petr Pudlak' via ganeti-devel wrote:
> We verify that 'readJSON . showJSON == Ok' and that maps are equal iff
> keys map to the same values.
> 
> Signed-off-by: Petr Pudlak <[email protected]>
> ---
>  Makefile.am                           |  1 +
>  src/Ganeti/Utils/MultiMap.hs          |  5 +++
>  test/hs/Test/Ganeti/Utils/MultiMap.hs | 72 
> +++++++++++++++++++++++++++++++++++
>  test/hs/htest.hs                      |  2 +
>  4 files changed, 80 insertions(+)
>  create mode 100644 test/hs/Test/Ganeti/Utils/MultiMap.hs

LGTM.  However, ...

> +instance (Arbitrary k, Ord k, Arbitrary v, Ord v)
> +         => Arbitrary (MultiMap k v) where
> +  arbitrary =
> +    let set = S.fromList <$> listOf arbitrary
> +    in (multiMap . M.fromList) <$> listOf ((,) <$> arbitrary <*> set)

...the test for extensional equality would be a lot more meaningful,
if all terms from the functions that MultiMap exports were taken.
But since that instantiation is fine for the serialisation test, it's
OK for this patch series. But please file a low-priority issue to replace
this instanciation by a more meaningful one.

-- 
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores

Reply via email to