Skip to content

Commit c0e1bb7

Browse files
author
gaa-cifasis
committed
fixed vCalendar generation bug and deleted useless dependency
1 parent 547d52b commit c0e1bb7

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

QuickFuzz.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ executable QuickFuzz
8888
build-depends: zlib, tar, zip-archive, base16-bytestring
8989

9090
if flag(docs)
91-
build-depends: pandoc-types, pandoc, data-default, hps, hcg-minus, iCalendar, quickcheck-instances
91+
build-depends: pandoc-types, pandoc, data-default, hps, hcg-minus, iCalendar
9292

9393
if flag(pki)
9494
build-depends: certificate, asn1-data, time

src/ICal.hs

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
module ICal where
55

66
import Test.QuickCheck
7-
import Test.QuickCheck.Instances
7+
88
import DeriveArbitrary
99
import Text.ICalendar.Types
1010
import Text.ICalendar.Printer
1111
import Data.Char (ord)
1212

13-
--import Time
1413
import qualified Data.ByteString.Lazy.Char8 as LC8
15-
1614
import qualified Data.ByteString.Lazy.Builder as Bu
1715

16+
import Time
17+
import Strings
18+
1819
$(devArbitrary ''VCalendar)
1920

2021
utf8Len :: Char -> Int

src/Strings.hs

+17
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ module Strings where
33
import Test.QuickCheck
44
import Data.Char (chr)
55

6+
import qualified Data.Text as TS
7+
import qualified Data.Text.Lazy as TL
8+
9+
-- Text
10+
instance Arbitrary TS.Text where
11+
arbitrary = TS.pack <$> arbitrary
12+
shrink xs = TS.pack <$> shrink (TS.unpack xs)
13+
14+
instance Arbitrary TL.Text where
15+
arbitrary = TL.pack <$> arbitrary
16+
shrink xs = TL.pack <$> shrink (TL.unpack xs)
17+
18+
instance CoArbitrary TS.Text where
19+
coarbitrary = coarbitrary . TS.unpack
20+
21+
instance CoArbitrary TL.Text where
22+
coarbitrary = coarbitrary . TL.unpack
623

724
genName :: Gen String
825
genName = listOf1 validChars :: Gen String

src/Svg.hs

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ import Images
4444

4545
data MSvgFile = MSvgFile Document deriving Show
4646

47-
instance Arbitrary DT.Text where
48-
arbitrary = do
49-
xs <- mgenName
50-
oneof $ Prelude.map (return . T.pack) [xs]
47+
--instance Arbitrary DT.Text where
48+
-- arbitrary = do
49+
-- xs <- mgenName
50+
-- oneof $ Prelude.map (return . T.pack) [xs]
5151

5252
instance Arbitrary String where
5353
arbitrary = mgenName

0 commit comments

Comments
 (0)