Skip to content

Commit 76f81ed

Browse files
committed
test: fix doctest
1 parent 6aeaadb commit 76f81ed

File tree

1 file changed

+3
-3
lines changed
  • Cabal-syntax/src/Distribution/Fields

1 file changed

+3
-3
lines changed

Cabal-syntax/src/Distribution/Fields/Parser.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ fieldInlineOrBraces name =
438438
-- Therefore bytestrings inside returned 'Field' will be invalid as UTF8 if the input were.
439439
--
440440
-- >>> readFields "foo: \223"
441-
-- Right [Field (Name (WithComments {justComments = [], unComments = Position 1 1}) "foo") [FieldLine (WithComments {justComments = [], unComments = Position 1 6}) "\223"]]
441+
-- Right [Field (Name (Position 1 1) "foo") [FieldLine (Position 1 6) "\223"]]
442442
--
443443
-- 'readFields' won't (necessarily) fail on invalid UTF8 data, but the reported positions may be off.
444444
--
@@ -452,12 +452,12 @@ fieldInlineOrBraces name =
452452
-- If there are just latin1 non-breaking spaces, they become part of the name:
453453
--
454454
-- >>> readFields "\xa0\&foo: bar"
455-
-- Right [Field (Name (WithComments {justComments = [], unComments = Position 1 1}) "\160foo") [FieldLine (WithComments {justComments = [], unComments = Position 1 7}) "bar"]]
455+
-- Right [Field (Name (Position 1 1) "\160foo") [FieldLine (Position 1 7) "bar"]]
456456
--
457457
-- The UTF8 non-breaking space is accepted as an indentation character (but warned about by 'readFields'').
458458
--
459459
-- >>> readFields' "\xc2\xa0 foo: bar"
460-
-- Right ([Field (Name (WithComments {justComments = [], unComments = Position 1 3}) "foo") [FieldLine (WithComments {justComments = [], unComments = Position 1 8}) "bar"]],[LexWarning LexWarningNBSP (Position 1 1)])
460+
-- Right ([Field (Name (Position 1 3) "foo") [FieldLine (Position 1 8) "bar"]],[LexWarning LexWarningNBSP (Position 1 1)])
461461
readFields :: B8.ByteString -> Either ParseError [Field Position]
462462
readFields = (fmap . map . fmap) unComments . readFieldsWithComments
463463

0 commit comments

Comments
 (0)