sizeTest :: (Show a) => IO (Widget a) -> PropertyM IO Bool
sizeTest mkWidget =
    forAllM sizeGen $ \sz -> do
      w <- run mkWidget
      img <- run $ render w sz defaultContext
      if regionHeight sz == 0 || regionWidth sz == 0 then
          return $ imageHeight img == 0 && imageWidth img == 0 else
          return $ imageWidth img <= regionWidth sz &&
                 imageHeight img <= regionHeight sz
sizeTest :: (Show a) => IO (Widget a) -> PropertyM IO Bool
sizeTest mkWidget =
    forAllM sizeGen $ \sz -> do
      w <- run mkWidget
      img <- run $ render w sz defaultContext
      if regionHeight sz == 0 || regionWidth sz == 0 then
          return $ imageHeight img == 0 && imageWidth img == 0 else
          return $ imageWidth img <= regionWidth sz &&
                 imageHeight img <= regionHeight sz
sizeTest mkWidget =
    forAllM sizeGen $ \sz -> do
      w <- run mkWidget
      img <- run $ render w sz defaultContext
      if regionHeight sz == 0 || regionWidth sz == 0 then
          return $ imageHeight img == 0 && imageWidth img == 0 else
          return $ imageWidth img <= regionWidth sz &&
                 imageHeight img <= regionHeight sz