File: Arbitrary.hs

package info (click to toggle)
haskell-hslua-core 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 288 kB
  • sloc: haskell: 2,243; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

{-# OPTIONS_GHC -fno-warn-orphans #-}
{-|
Module      :  HsLua.Core.RunTests
Copyright   :  © 2017-2024 Albert Krewinkel
License     :  MIT

Maintainer  :  Albert Krewinkel <tarleb@hslua.org>
Stability   :  stable
Portability :  portable

Instances for QuickCheck's Arbitrary.
-}
module Test.HsLua.Arbitrary () where

import HsLua.Core (Type)
import Test.QuickCheck (Arbitrary(arbitrary))
import qualified HsLua.Core as Lua
import qualified Test.QuickCheck as QC

instance Arbitrary Lua.Integer where
  arbitrary = QC.arbitrarySizedIntegral

instance Arbitrary Lua.Number where
  arbitrary = Lua.Number <$> arbitrary

instance Arbitrary Type where
  arbitrary = QC.arbitraryBoundedEnum