2015-12-03 19:44:28 +03:00
|
|
|
module Main where
|
2015-12-03 19:38:49 +03:00
|
|
|
|
2015-12-03 19:44:42 +03:00
|
|
|
import Split
|
2015-12-03 19:38:49 +03:00
|
|
|
import Test.Hspec
|
|
|
|
|
2015-11-18 01:44:16 +03:00
|
|
|
main :: IO ()
|
2015-12-03 19:44:42 +03:00
|
|
|
main = hspec $ do
|
|
|
|
describe "split" $ do
|
2015-12-03 19:47:51 +03:00
|
|
|
it "empty lines are the left unit" $
|
|
|
|
adjoinLines ([], []) ([ Line "a" ], [ Line "b" ]) `shouldBe` ([ Line "a" ], [ Line "b" ])
|
|
|
|
|
2015-12-03 19:58:34 +03:00
|
|
|
it "empty lines are the left unit for multiple lines" $
|
|
|
|
adjoinLines ([], []) ([ Line "a", Line "a" ], [ Line "b", Line "b" ]) `shouldBe` ([ Line "a", Line "a" ], [ Line "b", Line "b" ])
|
|
|
|
|
2015-12-03 19:44:42 +03:00
|
|
|
it "two single line elements should concatenate into a single line" $
|
2015-12-03 19:52:46 +03:00
|
|
|
adjoinLines ([ Line "a" ], [ Line "b" ]) ([ Line "a" ], [ Line "b" ]) `shouldBe` ([ Line "aa" ], [ Line "bb" ])
|