Tests
Some checks failed
Haskell CI / build (pull_request) Failing after 2m26s
Haskell CI / test (pull_request) Has been skipped
Haskell CI / fourmolu (pull_request) Has been skipped
Haskell CI / hlint (pull_request) Has been skipped

This commit is contained in:
Igor Ranieri 2025-10-05 15:19:24 +02:00
parent cae12ef4c0
commit 471de1c68a

View file

@ -1,3 +1,4 @@
{-# LANGUAGE MultilineStrings #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-orphans #-}
@ -18,18 +19,20 @@ main = hspec $ do
describe "minimal" do
it "handles unicode" unicode
it "escapes" escaping
it "images" images
it "maths" math
it "numeric entity" numericEntity
it "monospace" monospace
it "code blocks" codeBlocks
it "anchors" anchor
it "space chars" space
it "bare string" someString
it "emphasis" emphatic
it "monospace" monospace
it "labeled link" labeledLink
it "markdown link" link
it "bird tracks" birdTracks
it "module names" modules
it "quotes" quotes
it "numeric entity" numericEntity
it "ignores nesting" ignoreNesting
describe "Parser" do
@ -42,6 +45,18 @@ main = hspec $ do
-- Tests
------------
images :: Expectation
images = do
"<<image.png>>"
`shouldLexTo` [ (1, 3, Picture "image.png" Nothing)
]
"<<image.png title text>>"
`shouldLexTo` [ (1, 3, Picture "image.png" (Just "title text"))
]
"![alt text](image.png)"
`shouldLexTo` [ (1, 3, Picture "image.png" (Just "alt text"))
]
modules :: Expectation
modules = do
"\"MyModule.Name\""
@ -165,6 +180,18 @@ numericEntity = do
`shouldLexTo` [ (1, 1, NumericEntity 101)
]
codeBlocks :: Expectation
codeBlocks =
"""
@
func call here
@
"""
`shouldLexTo` [ (1, 1, MonospaceOpen)
, (1, 2, Token "\nfunc call here\n")
, (3, 1, MonospaceClose)
]
monospace :: Expectation
monospace =
"@mono@"