@@ -26,52 +26,52 @@ import Language.C.Inline.Context
26
26
27
27
spec :: Hspec. SpecWith ()
28
28
spec = do
29
- Hspec. it " converts simple type correctly (1)" $
29
+ Hspec. it " converts simple type correctly (1)" $ do
30
30
shouldBeType (cty " int" ) [t | CInt |]
31
- Hspec. it " converts simple type correctly (2)" $
31
+ Hspec. it " converts simple type correctly (2)" $ do
32
32
shouldBeType (cty " char" ) [t | CChar |]
33
- Hspec. it " converts void" $
33
+ Hspec. it " converts void" $ do
34
34
shouldBeType (cty " void" ) [t | () |]
35
- Hspec. it " converts standard library types (1)" $
35
+ Hspec. it " converts standard library types (1)" $ do
36
36
shouldBeType (cty " FILE" ) [t | CFile |]
37
- Hspec. it " converts standard library types (2)" $
37
+ Hspec. it " converts standard library types (2)" $ do
38
38
shouldBeType (cty " uint16_t" ) [t | Word16 |]
39
- Hspec. it " converts standard library types (3)" $
39
+ Hspec. it " converts standard library types (3)" $ do
40
40
shouldBeType (cty " jmp_buf" ) [t | CJmpBuf |]
41
- Hspec. it " converts single ptr type" $
41
+ Hspec. it " converts single ptr type" $ do
42
42
shouldBeType (cty " long*" ) [t | Ptr CLong |]
43
- Hspec. it " converts double ptr type" $
43
+ Hspec. it " converts double ptr type" $ do
44
44
shouldBeType (cty " unsigned long**" ) [t | Ptr (Ptr CULong) |]
45
- Hspec. it " converts arrays" $
45
+ Hspec. it " converts arrays" $ do
46
46
shouldBeType (cty " double[]" ) [t | CArray CDouble |]
47
- Hspec. it " converts named things" $
47
+ Hspec. it " converts named things" $ do
48
48
shouldBeType (cty " unsigned int foo[]" ) [t | CArray CUInt |]
49
- Hspec. it " converts arrays of pointers" $
49
+ Hspec. it " converts arrays of pointers" $ do
50
50
shouldBeType
51
51
(cty " unsigned short *foo[]" ) [t | CArray (Ptr CUShort) |]
52
- Hspec. it " ignores qualifiers" $
52
+ Hspec. it " ignores qualifiers" $ do
53
53
shouldBeType (cty " const short*" ) [t | Ptr CShort |]
54
- Hspec. it " ignores storage information" $
54
+ Hspec. it " ignores storage information" $ do
55
55
shouldBeType (cty " extern unsigned long" ) [t | CULong |]
56
- Hspec. it " converts sized arrays" $
56
+ Hspec. it " converts sized arrays" $ do
57
57
shouldBeType (cty " float[4]" ) [t | CArray CFloat |]
58
- Hspec. it " converts variably sized arrays" $
58
+ Hspec. it " converts variably sized arrays" $ do
59
59
shouldBeType (cty " float[*]" ) [t | CArray CFloat |]
60
- Hspec. it " converts function pointers" $
60
+ Hspec. it " converts function pointers" $ do
61
61
shouldBeType
62
62
(cty " int (*f)(unsigned char, float)" )
63
63
[t | FunPtr (CUChar -> CFloat -> IO CInt) |]
64
- Hspec. it " converts complicated function pointers (1)" $
64
+ Hspec. it " converts complicated function pointers (1)" $ do
65
65
-- pointer to function returning pointer to function returning int
66
66
shouldBeType
67
67
(cty " int (*(*)())()" ) [t | FunPtr (IO (FunPtr (IO CInt))) |]
68
- Hspec. it " converts complicated function pointerst (2)" $
68
+ Hspec. it " converts complicated function pointerst (2)" $ do
69
69
-- foo is an array of pointer to pointer to function returning
70
70
-- pointer to array of pointer to char
71
71
shouldBeType
72
72
(cty " char *(*(**foo [])())[]" )
73
73
[t | CArray (Ptr (FunPtr (IO (Ptr (CArray (Ptr CChar)))))) |]
74
- Hspec. it " converts complicated function pointers (3)" $
74
+ Hspec. it " converts complicated function pointers (3)" $ do
75
75
-- foo is an array of pointer to pointer to function taking int
76
76
-- returning pointer to array of pointer to char
77
77
shouldBeType
@@ -97,3 +97,5 @@ spec = do
97
97
cty s = C. parameterDeclarationType $ assertParse C. parseParameterDeclaration s
98
98
99
99
baseTypes = ctxTypesTable baseCtx
100
+
101
+ {- HLINT ignore spec "Redundant do" -}
0 commit comments