1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00
semantic/test/Spec.hs

17 lines
634 B
Haskell
Raw Normal View History

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
it "empty lines are the left unit" $
adjoinLines ([], []) ([ Line "a" ], [ Line "b" ]) `shouldBe` ([ Line "a" ], [ Line "b" ])
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" $
adjoinLines ([ Line "a" ], [ Line "b" ]) ([ Line "a" ], [ Line "b" ]) `shouldBe` ([ Line "aa" ], [ Line "bb" ])