Skip to content

Commit dc6a7b3

Browse files
committed
Fix tests for GHC 9.0.2
sol/doctest#327
1 parent 59eb86a commit dc6a7b3

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/Text/Email/QuasiQuotation.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ import Text.Email.Validate (validate, localPart, domainPart, unsafeEmailAddress)
1717

1818
-- | A QuasiQuoter for email addresses.
1919
--
20-
-- Use it like this:
20+
-- Use it like this (requires `QuasiQuotes` to be enabled):
2121
--
22-
-- >>> :set -XQuasiQuotes
2322
-- >>> [email|[email protected]|]
2423
2524
email :: QuasiQuoter

src/Text/Email/Validate.hs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,14 @@ import Text.Email.Parser
2424
, toByteString
2525
, unsafeEmailAddress)
2626

27-
-- $setup
28-
-- This is required for all examples:
29-
--
30-
-- >>> :set -XOverloadedStrings
31-
3227
-- | Smart constructor for an email address
3328
emailAddress :: ByteString -> Maybe EmailAddress
3429
emailAddress = either (const Nothing) Just . validate
3530

3631
-- | Checks that an email is valid and returns a version of it
3732
-- where comments and whitespace have been removed.
3833
--
39-
-- Example:
34+
-- Example (requires `OverloadedStrings` to be enabled):
4035
--
4136
-- >>> canonicalizeEmail "spaces. are. [email protected]"
4237
@@ -51,7 +46,7 @@ isValid = either (const False) (const True) . validate
5146
-- | If you want to find out *why* a particular string is not
5247
-- an email address, use this.
5348
--
54-
-- Examples:
49+
-- Examples (both require `OverloadedStrings` to be enabled):
5550
--
5651
-- >>> validate "[email protected]"
5752
@@ -60,4 +55,3 @@ isValid = either (const False) (const True) . validate
6055
-- Left "at sign > @: not enough input"
6156
validate :: ByteString -> Either String EmailAddress
6257
validate = parseOnly (addrSpec >>= \r -> endOfInput >> return r)
63-

tests/doctests.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ main = doctest
44
[ "-isrc"
55
, "src/Text/Email/QuasiQuotation.hs"
66
, "src/Text/Email/Validate.hs"
7+
, "-XQuasiQuotes"
8+
, "-XOverloadedStrings"
79
]

0 commit comments

Comments
 (0)