added test that currently fails for locating things properly

This commit is contained in:
Andrew Gibiansky 2013-12-29 18:06:35 -05:00
parent 35a6526af7
commit 6049811d61
2 changed files with 9 additions and 1 deletions

View File

@ -372,4 +372,12 @@ parseStringTests = describe "Parser" $ do
Nothing
Just 100))
|] `is` Expression
it "correctly locates parsed items" $ do
let go = doGhc . parseString
go [hereLit|
first
second
|] >>= (`shouldBe` [Located 1 (Expression "first"),
Located 2 (Expression "second")])

View File

@ -50,7 +50,7 @@ data CodeBlock
deriving (Show, Eq)
-- | Store locations along with a value.
data Located a = Located LineNumber a deriving Show
data Located a = Located LineNumber a deriving (Eq, Show)
-- | Directive types. Each directive is associated with a string in the
-- directive code block.