Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Unit test over the liquid haskell supported version #1449

Merged
merged 2 commits into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions haskell-ide-engine.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ test-suite unit-test
, hie-plugin-api
, hoogle > 5.0.11
, hspec
, process
, quickcheck-instances
, text
, unordered-containers
Expand Down
10 changes: 8 additions & 2 deletions test/unit/LiquidSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import qualified Data.ByteString.Lazy as BS
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Data.Monoid ((<>))
import Data.Maybe (isJust)
import Haskell.Ide.Engine.MonadTypes
import Haskell.Ide.Engine.Plugin.Liquid
import System.Directory
import System.Exit
import System.FilePath
import System.Process
import Test.Hspec
-- import Control.Monad.IO.Class

Expand All @@ -27,7 +27,13 @@ spec = do

-- ---------------------------------

it "finds liquid haskell exe in $PATH" $ findExecutable "liquid" >>= (`shouldSatisfy` isJust)
it "the liquid haskell exe in $PATH has the supported version" $ do
mexe <- findExecutable "liquid"
case mexe of
Nothing -> expectationFailure "liquid haskell exe is NOT in $PATH"
Just exe -> do
version <- readProcess exe ["--numeric-version"] ""
version `shouldSatisfy` isPrefixOf "0.8.6.2"

-- ---------------------------------

Expand Down