You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
504 B
19 lines
504 B
module Data.String.StripSpec (main, spec) where
|
|
|
|
import Test.Hspec
|
|
import Test.QuickCheck
|
|
|
|
import Data.String.Strip
|
|
|
|
-- `main` is here so that this module can be run from GHCi on its own. It is
|
|
-- not needed for automatic spec discovery.
|
|
main :: IO ()
|
|
main = hspec spec
|
|
|
|
spec :: Spec
|
|
spec = do
|
|
describe "strip" $ do
|
|
it "removes leading and trailing whitespace" $ do
|
|
strip "\t foo bar\n" `shouldBe` "foo bar"
|
|
it "is idempotent" $ property $
|
|
\str -> strip str === strip (strip str)
|