substring-parser-0.1.0.0: test/Spec.hs
{-# LANGUAGE OverloadedStrings #-}
import Test.Hspec
import Text.Parser.Substring
import Control.Applicative ((*>))
import Data.Attoparsec.Text
main :: IO ()
main = hspec $
describe "replaceWithParser" $
it "replace first matching text by parser" $
replaceOnceWithParser (string "abc" *> pure "def") "--abc-abc-"
`shouldBe` "--def-abc-"