Skip to content

Commit ee34ce7

Browse files
committed
update golden tests
1 parent 7938eb7 commit ee34ce7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3245
-2551
lines changed

hs-bindgen/fixtures/anonymous.hs

Lines changed: 72 additions & 76 deletions
Large diffs are not rendered by default.

hs-bindgen/fixtures/anonymous.pp.hs

Lines changed: 11 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,14 @@ import qualified Foreign.C as FC
88
import qualified GHC.Ptr as Ptr
99
import Prelude ((<*>), (>>), Eq, Int, Show, pure)
1010

11-
{-| __C declaration:__ @S1_c@
12-
13-
__defined at:__ @anonymous.h:3:3@
14-
15-
__exported by:__ @anonymous.h@
11+
{-|
1612
-}
1713
data S1_c = S1_c
1814
{ s1_c_a :: FC.CInt
19-
{- ^ __C declaration:__ @a@
20-
21-
__defined at:__ @anonymous.h:4:9@
22-
23-
__exported by:__ @anonymous.h@
15+
{- ^
2416
-}
2517
, s1_c_b :: FC.CInt
26-
{- ^ __C declaration:__ @b@
27-
28-
__defined at:__ @anonymous.h:5:9@
29-
30-
__exported by:__ @anonymous.h@
18+
{- ^
3119
-}
3220
}
3321
deriving stock (Eq, Show)
@@ -96,19 +84,11 @@ instance F.Storable S1 where
9684
F.pokeByteOff ptr0 (0 :: Int) s1_c2
9785
>> F.pokeByteOff ptr0 (8 :: Int) s1_d3
9886

99-
{-| __C declaration:__ @S2_inner_deep@
100-
101-
__defined at:__ @anonymous.h:15:5@
102-
103-
__exported by:__ @anonymous.h@
87+
{-|
10488
-}
10589
data S2_inner_deep = S2_inner_deep
10690
{ s2_inner_deep_b :: FC.CInt
107-
{- ^ __C declaration:__ @b@
108-
109-
__defined at:__ @anonymous.h:16:11@
110-
111-
__exported by:__ @anonymous.h@
91+
{- ^
11292
-}
11393
}
11494
deriving stock (Eq, Show)
@@ -131,26 +111,14 @@ instance F.Storable S2_inner_deep where
131111
S2_inner_deep s2_inner_deep_b2 ->
132112
F.pokeByteOff ptr0 (0 :: Int) s2_inner_deep_b2
133113

134-
{-| __C declaration:__ @S2_inner@
135-
136-
__defined at:__ @anonymous.h:13:3@
137-
138-
__exported by:__ @anonymous.h@
114+
{-|
139115
-}
140116
data S2_inner = S2_inner
141117
{ s2_inner_a :: FC.CInt
142-
{- ^ __C declaration:__ @a@
143-
144-
__defined at:__ @anonymous.h:14:9@
145-
146-
__exported by:__ @anonymous.h@
118+
{- ^
147119
-}
148120
, s2_inner_deep :: S2_inner_deep
149-
{- ^ __C declaration:__ @deep@
150-
151-
__defined at:__ @anonymous.h:17:7@
152-
153-
__exported by:__ @anonymous.h@
121+
{- ^
154122
-}
155123
}
156124
deriving stock (Eq, Show)
@@ -219,26 +187,14 @@ instance F.Storable S2 where
219187
F.pokeByteOff ptr0 (0 :: Int) s2_inner2
220188
>> F.pokeByteOff ptr0 (8 :: Int) s2_d3
221189

222-
{-| __C declaration:__ @S3_c@
223-
224-
__defined at:__ @anonymous.h:25:3@
225-
226-
__exported by:__ @anonymous.h@
190+
{-|
227191
-}
228192
data S3_c = S3_c
229193
{ s3_c_a :: FC.CInt
230-
{- ^ __C declaration:__ @a@
231-
232-
__defined at:__ @anonymous.h:26:9@
233-
234-
__exported by:__ @anonymous.h@
194+
{- ^
235195
-}
236196
, s3_c_b :: FC.CInt
237-
{- ^ __C declaration:__ @b@
238-
239-
__defined at:__ @anonymous.h:27:9@
240-
241-
__exported by:__ @anonymous.h@
197+
{- ^
242198
-}
243199
}
244200
deriving stock (Eq, Show)

hs-bindgen/fixtures/anonymous.th.txt

Lines changed: 15 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
11
-- addDependentFile examples/golden/anonymous.h
2-
{-| __C declaration:__ @S1_c@
3-
4-
__defined at:__ @anonymous.h:3:3@
5-
6-
__exported by:__ @anonymous.h@
2+
{-|
73
-}
84
data S1_c
95
= S1_c {s1_c_a :: CInt
10-
{- ^ __C declaration:__ @a@
11-
12-
__defined at:__ @anonymous.h:4:9@
13-
14-
__exported by:__ @anonymous.h@
6+
{- ^
157
-},
168
s1_c_b :: CInt
17-
{- ^ __C declaration:__ @b@
18-
19-
__defined at:__ @anonymous.h:5:9@
20-
21-
__exported by:__ @anonymous.h@
9+
{- ^
2210
-}}
23-
{- ^ __C declaration:__ @S1_c@
24-
25-
__defined at:__ @anonymous.h:3:3@
26-
27-
__exported by:__ @anonymous.h@
11+
{- ^
2812
-}
2913
deriving stock (Eq, Show)
3014
instance Storable S1_c
@@ -69,25 +53,13 @@ instance Storable S1
6953
poke = \ptr_1 -> \s_2 -> case s_2 of
7054
S1 s1_c_3
7155
s1_d_4 -> pokeByteOff ptr_1 (0 :: Int) s1_c_3 >> pokeByteOff ptr_1 (8 :: Int) s1_d_4
72-
{-| __C declaration:__ @S2_inner_deep@
73-
74-
__defined at:__ @anonymous.h:15:5@
75-
76-
__exported by:__ @anonymous.h@
56+
{-|
7757
-}
7858
data S2_inner_deep
7959
= S2_inner_deep {s2_inner_deep_b :: CInt
80-
{- ^ __C declaration:__ @b@
81-
82-
__defined at:__ @anonymous.h:16:11@
83-
84-
__exported by:__ @anonymous.h@
60+
{- ^
8561
-}}
86-
{- ^ __C declaration:__ @S2_inner_deep@
87-
88-
__defined at:__ @anonymous.h:15:5@
89-
90-
__exported by:__ @anonymous.h@
62+
{- ^
9163
-}
9264
deriving stock (Eq, Show)
9365
instance Storable S2_inner_deep
@@ -96,32 +68,16 @@ instance Storable S2_inner_deep
9668
peek = \ptr_0 -> pure S2_inner_deep <*> peekByteOff ptr_0 (0 :: Int)
9769
poke = \ptr_1 -> \s_2 -> case s_2 of
9870
S2_inner_deep s2_inner_deep_b_3 -> pokeByteOff ptr_1 (0 :: Int) s2_inner_deep_b_3
99-
{-| __C declaration:__ @S2_inner@
100-
101-
__defined at:__ @anonymous.h:13:3@
102-
103-
__exported by:__ @anonymous.h@
71+
{-|
10472
-}
10573
data S2_inner
10674
= S2_inner {s2_inner_a :: CInt
107-
{- ^ __C declaration:__ @a@
108-
109-
__defined at:__ @anonymous.h:14:9@
110-
111-
__exported by:__ @anonymous.h@
75+
{- ^
11276
-},
11377
s2_inner_deep :: S2_inner_deep
114-
{- ^ __C declaration:__ @deep@
115-
116-
__defined at:__ @anonymous.h:17:7@
117-
118-
__exported by:__ @anonymous.h@
78+
{- ^
11979
-}}
120-
{- ^ __C declaration:__ @S2_inner@
121-
122-
__defined at:__ @anonymous.h:13:3@
123-
124-
__exported by:__ @anonymous.h@
80+
{- ^
12581
-}
12682
deriving stock (Eq, Show)
12783
instance Storable S2_inner
@@ -166,32 +122,16 @@ instance Storable S2
166122
poke = \ptr_1 -> \s_2 -> case s_2 of
167123
S2 s2_inner_3
168124
s2_d_4 -> pokeByteOff ptr_1 (0 :: Int) s2_inner_3 >> pokeByteOff ptr_1 (8 :: Int) s2_d_4
169-
{-| __C declaration:__ @S3_c@
170-
171-
__defined at:__ @anonymous.h:25:3@
172-
173-
__exported by:__ @anonymous.h@
125+
{-|
174126
-}
175127
data S3_c
176128
= S3_c {s3_c_a :: CInt
177-
{- ^ __C declaration:__ @a@
178-
179-
__defined at:__ @anonymous.h:26:9@
180-
181-
__exported by:__ @anonymous.h@
129+
{- ^
182130
-},
183131
s3_c_b :: CInt
184-
{- ^ __C declaration:__ @b@
185-
186-
__defined at:__ @anonymous.h:27:9@
187-
188-
__exported by:__ @anonymous.h@
132+
{- ^
189133
-}}
190-
{- ^ __C declaration:__ @S3_c@
191-
192-
__defined at:__ @anonymous.h:25:3@
193-
194-
__exported by:__ @anonymous.h@
134+
{- ^
195135
-}
196136
deriving stock (Eq, Show)
197137
instance Storable S3_c

0 commit comments

Comments
 (0)