{-# LANGUAGE OverloadedStrings #-} module Main (main) where import Tags (parseTags) import Test.Hspec main :: IO () main = hspec $ describe "Parser" $ do it "Returns no results if there are no tags" $ parseTags "foo bar" `shouldBe` [] it "Returns a single result" $ parseTags "[foo]" `shouldBe` ["foo"] it "Finds multiple results" $ parseTags "[foo][bar]" `shouldBe` ["foo", "bar"] it "Finds multiple results with other text interleaved" $ parseTags "prefix [foo] infix [bar] suffix" `shouldBe` ["foo", "bar"]