gdritter repos config-ini / 5ddff57
Fix ini-compat test and add lower version bound Getty Ritter 3 years ago
2 changed file(s) with 7 addition(s) and 5 deletion(s). Collapse all Expand all
5959 hs-source-dirs: test/ini-compat
6060 main-is: Main.hs
6161 build-depends: base
62 , ini
62 , ini >=4.0
6363 , config-ini
6464 , hedgehog
6565 , containers
5050 Right (toMaps raw) === fmap toMaps (I2.parseRawIni (I2.printRawIni raw))
5151
5252 lower :: I1.Ini -> HashMap Text (HashMap Text Text)
53 lower (I1.Ini ini) = go (fmap go ini)
54 where go hm = HM.fromList [ (T.toLower k, v) | (k, v) <- HM.toList hm ]
53 lower (I1.Ini sections _) = HM.fromList
54 [ (T.toLower sectionName, HM.fromList [ (T.toLower k, v) | (k, v) <- section ])
55 | (sectionName, section) <- HM.toList sections
56 ]
5557
5658 toMaps :: I2.RawIni -> HashMap Text (HashMap Text Text)
5759 toMaps (I2.RawIni m) = conv (fmap sectionToPair m)
7072 name <- textChunk
7173 section <- Gen.list (Range.linear 0 10) $
7274 (,) <$> textChunk <*> textChunk
73 return (name, HM.fromList section)
74 return (I1.Ini (HM.fromList ss))
75 return (name, section)
76 return (I1.Ini (HM.fromList ss) [])
7577
7678 mkComments :: Gen (Seq.Seq I2.BlankLine)
7779 mkComments = fmap Seq.fromList $ Gen.list (Range.linear 0 5) $