1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
module Test.Hspec.Core.Config.DefinitionSpec (spec) where
import Prelude ()
import Helper
import Test.Hspec.Core.Config.Definition
spec :: Spec
spec = do
describe "splitOn" $ do
it "splits a string" $ do
splitOn ',' "foo,bar,baz" `shouldBe` ["foo", "bar", "baz"]
it "splits *arbitrary* strings" $ property $ do
let
string :: Gen String
string = arbitrary `suchThat` p
p :: String -> Bool
p = (&&) <$> not . null <*> all (/= ',')
forAll (listOf string) $ \ xs -> splitOn ',' (intercalate "," xs) `shouldBe` xs
|