Adjusted others, labeled link

This commit is contained in:
Igor Ranieri 2025-09-21 13:30:01 +02:00
parent 4ef8d2c28c
commit 7d4cab4857
2 changed files with 106 additions and 41 deletions

View file

@ -23,6 +23,7 @@ main = hspec $ do
it "bare string" someString
it "emphasis" emphatic
it "monospace" monospace
it "labeled link" labeledLink
it "bird tracks" birdTracks
it "quotes" quotes
it "ignores nesting" ignoreNesting
@ -37,6 +38,20 @@ main = hspec $ do
-- Tests
------------
labeledLink :: Expectation
labeledLink =
"<[link here](http://to.here) label>"
`shouldLexTo` [ (1, 1, LabeledLinkOpen)
, (1, 2, BracketOpen)
, (1, 3, Token "link here")
, (1, 12, BracketClose)
, (1, 13, ParenOpen)
, (1, 14, Token "http://to.here")
, (1, 28, ParenClose)
, (1, 29, Space)
, (1, 30, Token "label>")
]
maths :: IO ()
maths = do
"\\[some math\\]"
@ -60,8 +75,7 @@ escaping =
unicode :: Expectation
unicode =
"ドラゴンクエストの冒険者🐉"
`shouldLexTo` [ (1, 1, Token "ドラゴンクエストの冒険者")
, (1, 13, Token "🐉")
`shouldLexTo` [ (1, 1, Token "ドラゴンクエストの冒険者🐉")
]
ignoreNesting :: Expectation