From b3bb9e2c3e52969fe18c68325578d79a76cc8e51 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 15 Mar 2016 10:50:13 -0400 Subject: [PATCH] Test that Both coalesces when both sides coalesce. --- test/Data/Functor/Both/Spec.hs | 13 ++++++++++++- test/Spec.hs | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/test/Data/Functor/Both/Spec.hs b/test/Data/Functor/Both/Spec.hs index e1ce51f28..25d998543 100644 --- a/test/Data/Functor/Both/Spec.hs +++ b/test/Data/Functor/Both/Spec.hs @@ -1 +1,12 @@ -module Data.Functor.Both.Spec where +module Data.Functor.Both.Spec (spec) where + +import Data.Coalescent +import Data.Functor.Both +import Line +import Test.Hspec + +spec :: Spec +spec = do + describe "Coalescent" $ do + it "should coalesce when both sides coalesce" $ + (both (Line [True]) (Line [True]) `coalesce` both (Line [True]) (Line [True]) :: [Both (Line Bool)]) `shouldBe` [both (Line [True, True]) (Line [True, True])] diff --git a/test/Spec.hs b/test/Spec.hs index ba2c9bd74..0f6609a7a 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -3,6 +3,7 @@ module Main where import qualified AlignmentSpec import qualified CorpusSpec import qualified Data.Adjoined.Spec +import qualified Data.Functor.Both.Spec import qualified InterpreterSpec import qualified OrderedMapSpec import qualified PatchOutputSpec @@ -14,6 +15,7 @@ main = hspec $ parallel $ do describe "Alignment" AlignmentSpec.spec describe "Corpus" CorpusSpec.spec describe "Data.Adjoined" Data.Adjoined.Spec.spec + describe "Data.Functor.Both" Data.Functor.Both.Spec.spec describe "Interpreter" InterpreterSpec.spec describe "OrderedMap" OrderedMapSpec.spec describe "PatchOutput" PatchOutputSpec.spec