git.iko.soy/typeable/pandoc
on master help sign in
Lua filter tests: produce better error on test failure
commitdba5c8d4e39c0bedf2a46191ad393bf84620bee5 authorAlbert Krewinkel <albert@zeitkraut.de> dateWed 19 Sep 2018, 21:27 (8 years ago) parent4264a1b
1 file changed+2−2
test/Tests/Lua.hs+2−2
test/Tests/Lua.hs+2−2
@@ -7,7 +7,7 @@ import Control.Monad (when)
77import Data.Version (Version (versionBranch))
88import System.FilePath ((</>))
99import Test.Tasty (TestTree, localOption)
10−import Test.Tasty.HUnit (Assertion, assertEqual, testCase)
10+import Test.Tasty.HUnit (Assertion, assertEqual, assertFailure, testCase)
1111import Test.Tasty.QuickCheck (QuickCheckTests (..), ioProperty, testProperty)
1212import Text.Pandoc.Arbitrary ()
1313import Text.Pandoc.Builder (bulletList, divWith, doc, doubleQuoted, emph,
@@ -179,7 +179,7 @@ assertFilterConversion msg filterPath docIn docExpected = do
179179 setUserDataDir (Just "../data")
180180 runLuaFilter def ("lua" </> filterPath) [] docIn
181181 case docEither of
182− Left _ -> fail "lua filter failed"
182+ Left exception -> assertFailure (show exception)
183183 Right docRes -> assertEqual msg docExpected docRes
184184
185185roundtripEqual :: (Eq a, Lua.FromLuaStack a, Lua.ToLuaStack a) => a -> IO Bool