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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

19 lines
504 B

7 years ago
  1. module Data.String.StripSpec (main, spec) where
  2. import Test.Hspec
  3. import Test.QuickCheck
  4. import Data.String.Strip
  5. -- `main` is here so that this module can be run from GHCi on its own. It is
  6. -- not needed for automatic spec discovery.
  7. main :: IO ()
  8. main = hspec spec
  9. spec :: Spec
  10. spec = do
  11. describe "strip" $ do
  12. it "removes leading and trailing whitespace" $ do
  13. strip "\t foo bar\n" `shouldBe` "foo bar"
  14. it "is idempotent" $ property $
  15. \str -> strip str === strip (strip str)