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

module Main where
import Split
import Test.Hspec
main :: IO ()
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" ])
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" ])