Skip to content

Commit 65ab56b

Browse files
Test with values of type MonoidMap k v.
This commit expands test coverage to test with objects of type `MonoidMap k1 (MonoidMap k2 v)`. We use `Ordering` (a type with only a small number of inhabitants) for the inner key type to limit the size of generated maps.
1 parent a343891 commit 65ab56b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

components/monoidmap-test/Test/Common.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,14 @@ testValueTypesAll =
188188
, TestValueType (Proxy @(Text))
189189
, TestValueType (Proxy @[Int])
190190
, TestValueType (Proxy @[Natural])
191+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Int)))
192+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Natural)))
191193
]
192194

193195
testValueTypesGroup :: [TestValueType Group]
194196
testValueTypesGroup =
195197
[ TestValueType (Proxy @(Sum Int))
198+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Int)))
196199
]
197200

198201
testValueTypesMonus :: [TestValueType Monus]
@@ -201,6 +204,7 @@ testValueTypesMonus =
201204
, TestValueType (Proxy @(Set Int))
202205
, TestValueType (Proxy @(Set Natural))
203206
, TestValueType (Proxy @(Sum Natural))
207+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Natural)))
204208
]
205209

206210
testValueTypesLeftReductive :: [TestValueType LeftReductive]
@@ -217,6 +221,7 @@ testValueTypesLeftReductive =
217221
, TestValueType (Proxy @(Text))
218222
, TestValueType (Proxy @[Int])
219223
, TestValueType (Proxy @[Natural])
224+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Natural)))
220225
]
221226

222227
testValueTypesRightReductive :: [TestValueType RightReductive]
@@ -233,6 +238,7 @@ testValueTypesRightReductive =
233238
, TestValueType (Proxy @(Text))
234239
, TestValueType (Proxy @[Int])
235240
, TestValueType (Proxy @[Natural])
241+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Natural)))
236242
]
237243

238244
testValueTypesReductive :: [TestValueType Reductive]
@@ -243,6 +249,7 @@ testValueTypesReductive =
243249
, TestValueType (Proxy @(Set Natural))
244250
, TestValueType (Proxy @(Sum Int))
245251
, TestValueType (Proxy @(Sum Natural))
252+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Natural)))
246253
]
247254

248255
testValueTypesLeftGCDMonoid :: [TestValueType LeftGCDMonoid]
@@ -253,6 +260,7 @@ testValueTypesLeftGCDMonoid =
253260
, TestValueType (Proxy @(Set Natural))
254261
, TestValueType (Proxy @(Sum Natural))
255262
, TestValueType (Proxy @(Text))
263+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Natural)))
256264
]
257265

258266
testValueTypesRightGCDMonoid :: [TestValueType RightGCDMonoid]
@@ -263,6 +271,7 @@ testValueTypesRightGCDMonoid =
263271
, TestValueType (Proxy @(Set Natural))
264272
, TestValueType (Proxy @(Sum Natural))
265273
, TestValueType (Proxy @(Text))
274+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Natural)))
266275
]
267276

268277
testValueTypesOverlappingGCDMonoid :: [TestValueType OverlappingGCDMonoid]
@@ -273,6 +282,7 @@ testValueTypesOverlappingGCDMonoid =
273282
, TestValueType (Proxy @(Set Natural))
274283
, TestValueType (Proxy @(Sum Natural))
275284
, TestValueType (Proxy @(Text))
285+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Natural)))
276286
]
277287

278288
testValueTypesGCDMonoid :: [TestValueType GCDMonoid]
@@ -281,6 +291,7 @@ testValueTypesGCDMonoid =
281291
, TestValueType (Proxy @(Set Int))
282292
, TestValueType (Proxy @(Set Natural))
283293
, TestValueType (Proxy @(Sum Natural))
294+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Natural)))
284295
]
285296

286297
testValueTypesLCMMonoid :: [TestValueType LCMMonoid]
@@ -289,6 +300,7 @@ testValueTypesLCMMonoid =
289300
, TestValueType (Proxy @(Set Int))
290301
, TestValueType (Proxy @(Set Natural))
291302
, TestValueType (Proxy @(Sum Natural))
303+
, TestValueType (Proxy @(MonoidMap Ordering (Sum Natural)))
292304
]
293305

294306
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)