1module DataFamilies.Properties (tests) where
3import DataFamilies.Encoders
4import DataFamilies.Instances ()
6import Properties hiding (tests)
8import Test.Framework (Test, testGroup)
9import Test.Framework.Providers.QuickCheck2 (testProperty)
11--------------------------------------------------------------------------------
14tests = testGroup "data families" [
15 testGroup "template-haskell" [
18 testProperty "string" (isString . thNullaryToJSONString)
19 , testProperty "2ElemArray" (is2ElemArray . thNullaryToJSON2ElemArray)
20 , testProperty "TaggedObject" (isTaggedObjectValue . thNullaryToJSONTaggedObject)
21 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thNullaryToJSONObjectWithSingleField)
23 , testGroup "roundTrip" [
24 testProperty "string" (toParseJSON thNullaryParseJSONString thNullaryToJSONString)
25 , testProperty "2ElemArray" (toParseJSON thNullaryParseJSON2ElemArray thNullaryToJSON2ElemArray)
26 , testProperty "TaggedObject" (toParseJSON thNullaryParseJSONTaggedObject thNullaryToJSONTaggedObject)
27 , testProperty "ObjectWithSingleField" (toParseJSON thNullaryParseJSONObjectWithSingleField thNullaryToJSONObjectWithSingleField)
30 , testGroup "SomeType" [
31 testProperty "2ElemArray" (is2ElemArray . thSomeTypeToJSON2ElemArray)
32 , testProperty "TaggedObject" (isTaggedObject . thSomeTypeToJSONTaggedObject)
33 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thSomeTypeToJSONObjectWithSingleField)
34 , testGroup "roundTrip" [
35 testProperty "2ElemArray" (toParseJSON thSomeTypeParseJSON2ElemArray thSomeTypeToJSON2ElemArray)
36 , testProperty "TaggedObject" (toParseJSON thSomeTypeParseJSONTaggedObject thSomeTypeToJSONTaggedObject)
37 , testProperty "ObjectWithSingleField" (toParseJSON thSomeTypeParseJSONObjectWithSingleField thSomeTypeToJSONObjectWithSingleField)
39 , testGroup "Approx" [
40 testProperty "string" (isString . thApproxToJSONUnwrap)
41 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thApproxToJSONDefault)
42 , testGroup "roundTrip" [
43 testProperty "string" (toParseJSON thApproxParseJSONUnwrap thApproxToJSONUnwrap)
44 , testProperty "ObjectWithSingleField" (toParseJSON thApproxParseJSONDefault thApproxToJSONDefault)
48 testProperty "string" (isString . thGADTToJSONUnwrap)
49 , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thGADTToJSONDefault)
50 , testGroup "roundTrip" [
51 testProperty "string" (toParseJSON thGADTParseJSONUnwrap thGADTToJSONUnwrap)
52 , testProperty "ObjectWithSingleField" (toParseJSON thGADTParseJSONDefault thGADTToJSONDefault)
57 , testGroup "toEncoding" [
58 testProperty "NullaryString" $
59 thNullaryToJSONString `sameAs` thNullaryToEncodingString
60 , testProperty "Nullary2ElemArray" $
61 thNullaryToJSON2ElemArray `sameAs` thNullaryToEncoding2ElemArray
62 , testProperty "NullaryTaggedObject" $
63 thNullaryToJSONTaggedObject `sameAs` thNullaryToEncodingTaggedObject
64 , testProperty "NullaryObjectWithSingleField" $
65 thNullaryToJSONObjectWithSingleField `sameAs`
66 thNullaryToEncodingObjectWithSingleField
67 , testProperty "ApproxUnwrap" $
68 thApproxToJSONUnwrap `sameAs` thApproxToEncodingUnwrap
69 , testProperty "ApproxDefault" $
70 thApproxToJSONDefault `sameAs` thApproxToEncodingDefault
71 , testProperty "SomeType2ElemArray" $
72 thSomeTypeToJSON2ElemArray `sameAs` thSomeTypeToEncoding2ElemArray
73 , testProperty "SomeTypeTaggedObject" $
74 thSomeTypeToJSONTaggedObject `sameAs` thSomeTypeToEncodingTaggedObject
75 , testProperty "SomeTypeObjectWithSingleField" $
76 thSomeTypeToJSONObjectWithSingleField `sameAs`
77 thSomeTypeToEncodingObjectWithSingleField
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list