Revision dde8b625 test/hs/Test/Ganeti/JSON.hs
b/test/hs/Test/Ganeti/JSON.hs | ||
---|---|---|
28 | 28 |
|
29 | 29 |
module Test.Ganeti.JSON (testJSON) where |
30 | 30 |
|
31 |
import Control.Monad |
|
31 | 32 |
import Data.List |
32 | 33 |
import Test.QuickCheck |
33 | 34 |
|
... | ... | |
35 | 36 |
|
36 | 37 |
import Test.Ganeti.TestHelper |
37 | 38 |
import Test.Ganeti.TestCommon |
39 |
import Test.Ganeti.Types () |
|
38 | 40 |
|
39 | 41 |
import qualified Ganeti.BasicTypes as BasicTypes |
40 | 42 |
import qualified Ganeti.JSON as JSON |
41 | 43 |
|
44 |
instance Arbitrary JSON.TimeAsDoubleJSON where |
|
45 |
arbitrary = liftM JSON.TimeAsDoubleJSON arbitrary |
|
46 |
|
|
42 | 47 |
prop_toArray :: [Int] -> Property |
43 | 48 |
prop_toArray intarr = |
44 | 49 |
let arr = map J.showJSON intarr in |
... | ... | |
76 | 81 |
, Data.List.isInfixOf k e ==? True |
77 | 82 |
] |
78 | 83 |
|
84 |
prop_TimeAsDoubleJSON_serialisation :: JSON.TimeAsDoubleJSON -> Property |
|
85 |
prop_TimeAsDoubleJSON_serialisation = testSerialisation |
|
86 |
|
|
79 | 87 |
testSuite "JSON" |
80 | 88 |
[ 'prop_toArray |
81 | 89 |
, 'prop_toArrayFail |
82 | 90 |
, 'prop_arrayMaybeFromObj |
83 | 91 |
, 'prop_arrayMaybeFromObjFail |
92 |
, 'prop_TimeAsDoubleJSON_serialisation |
|
84 | 93 |
] |
Also available in: Unified diff