1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

fix the specs

This commit is contained in:
Patrick Thomson 2018-06-29 16:17:27 -04:00
parent bef406b5c7
commit 1eed347da6
3 changed files with 10 additions and 1 deletions

View File

@ -12,8 +12,8 @@ import Data.Term
import Data.These
import Diffing.Algorithm
import Diffing.Algorithm.RWS
import Test.Hspec
import Test.Hspec.LeanCheck
import SpecHelpers
spec :: Spec
spec = parallel $ do

View File

@ -14,6 +14,7 @@ import Test.Hspec (Spec, describe, it, parallel)
import Test.Hspec.Expectations.Pretty
import Test.Hspec.LeanCheck
import Test.LeanCheck.Core
import SpecHelpers
spec :: Spec
spec = parallel $ do

View File

@ -1,3 +1,5 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
module SpecHelpers
( module X
, runBuilder
@ -41,6 +43,7 @@ import Data.Record as X
import Data.Semilattice.Lower as X
import Data.Source as X
import Data.Span as X
import Data.String
import Data.Sum
import Data.Term as X
import Parsing.Parser as X
@ -68,6 +71,11 @@ import qualified Semantic.IO as IO
runBuilder = toStrict . toLazyByteString
-- | This orphan instance is so we don't have to insert @name@ calls
-- in dozens and dozens of environment specs.
instance IsString Name where
fromString = name . fromString
-- | Returns an s-expression formatted diff for the specified FilePath pair.
diffFilePaths :: Both FilePath -> IO ByteString
diffFilePaths paths = readFilePair paths >>= fmap runBuilder . runTask . runDiff SExpressionDiffRenderer . pure