Revision 4884f187 test/hs/Test/Ganeti/OpCodes.hs

b/test/hs/Test/Ganeti/OpCodes.hs
431 431
  octets <- vectorOf 3 $ choose (0::Int, 255)
432 432
  mkNonEmpty . intercalate ":" $ map (printf "%02x") octets
433 433

  
434
-- | JSObject of arbitrary data.
435
--
436
-- Since JSValue does not implement Arbitrary, I'll simply generate
437
-- (String, String) objects.
438
arbitraryPrivateJSObj :: Gen (J.JSObject (Private J.JSValue))
439
arbitraryPrivateJSObj =
440
  constructor <$> (fromNonEmpty <$> genNameNE)
441
              <*> (fromNonEmpty <$> genNameNE)
442
    where constructor k v = showPrivateJSObject [(k, v)]
443

  
434 444
-- | Arbitrary instance for MetaOpCode, defined here due to TH ordering.
435 445
$(genArbitrary ''OpCodes.MetaOpCode)
436 446

  

Also available in: Unified diff