updated to most recent LTS
This commit is contained in:
@@ -20,6 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
module SubFix.DecodeSpec (spec) where
|
||||
|
||||
import Data.Either (fromRight, fromLeft)
|
||||
import Test.Hspec (Spec, context, describe, it, shouldBe)
|
||||
|
||||
import SubFix (Caption (..), decode)
|
||||
@@ -30,7 +31,7 @@ spec = describe "decode" $ do
|
||||
context "valid inputs" $ mapM_
|
||||
( \(label, input, expected) ->
|
||||
context label $ do
|
||||
let Right results = decode input
|
||||
let results = fromRight (error "Left") $ decode input
|
||||
|
||||
context "number of results" $ let
|
||||
rlen = length results
|
||||
@@ -57,7 +58,7 @@ spec = describe "decode" $ do
|
||||
context "invalid inputs" $ mapM_
|
||||
( \(label, input, expected) ->
|
||||
context label $ let
|
||||
Left result = decode input
|
||||
result = fromLeft (error "Right") $ decode input
|
||||
in it ("should be: " ++ expected) $
|
||||
result `shouldBe` expected
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user