mirror of
https://github.com/github/semantic.git
synced 2024-12-01 00:33:59 +03:00
fix the specs
This commit is contained in:
parent
bef406b5c7
commit
1eed347da6
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user