Skip to content

Commit f69de40

Browse files
committed
Adapt expected error string in stack-snapshot-deps test
Before, it expected "parsing JSON failed", but the json.decode function returns a different error: ``` Error in decode: at offset 5, invalid number: 2.3.1 ```
1 parent 2cc23e4 commit f69de40

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

rules_haskell_tests/tests/stack-snapshot-deps/HsOverrideStackTest.hs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
import Data.List (isInfixOf)
44
import IntegrationTesting
5-
import Test.Hspec (hspec, it)
5+
import Test.Hspec (describe, hspec, it)
66

77
main :: IO ()
88
main = hspec $ do
9-
it "bazel run repl" $ do
10-
bazel <- setupTestBazel
11-
let p (_stdout, stderr) = "parsing JSON failed" `isInfixOf` stderr
12-
in
13-
failedOutputSatisfy p (bazel ["run", "//:hs-bin@repl", "--", "-ignore-dot-ghci", "-e", ":main"])
9+
describe "bazel run repl" $ do
10+
it "fails with a json decode error" $ do
11+
-- this is evidence that it used the deficient `stack` script provided in hs_override_stack_test/
12+
bazel <- setupTestBazel
13+
let p (_stdout, stderr) = "Error in decode: at offset" `isInfixOf` stderr
14+
in
15+
failedOutputSatisfy p (bazel ["run", "//:hs-bin@repl", "--", "-ignore-dot-ghci", "-e", ":main"])

0 commit comments

Comments
 (0)