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

Commit 26b1733

Browse files
committed
Fix unit test checking hie version
1 parent 6078db6 commit 26b1733

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

haskell-ide-engine.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ test-suite unit-test
205205
LiquidSpec
206206
OptionsSpec
207207
PackagePluginSpec
208+
Paths_haskell_ide_engine
208209
Spec
209210
-- Technically cabal-helper should be a 'run-tool-depends', but that doesn't exist yet
210211
build-tool-depends: cabal-helper:cabal-helper-main, hspec-discover:hspec-discover

test/unit/OptionsSpec.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ module OptionsSpec where
22

33
import Prelude hiding (unzip)
44
import Data.List.NonEmpty(unzip)
5+
import Data.Version (showVersion)
56
import Test.Hspec
67
import Options.Applicative
78
import Haskell.Ide.Engine.Options(GlobalOpts(..), RunMode(..), ProjectLoadingOpts(..), optionParser)
89
import System.Exit(ExitCode(..))
910
import Data.List(isPrefixOf)
11+
import Paths_haskell_ide_engine as HIE (version)
1012

1113
main :: IO ()
1214
main = hspec spec
@@ -39,7 +41,7 @@ spec = do
3941
let (maybeMessage, maybeStatusCode) = unzip $ getParseFailure result
4042

4143
it "should return version" $
42-
maybeMessage `shouldBe` Just "1.1"
44+
maybeMessage `shouldBe` Just (showVersion HIE.version)
4345
it "shoud return exit code 0" $
4446
maybeStatusCode `shouldBe` Just ExitSuccess
4547

0 commit comments

Comments
 (0)