File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -396,6 +396,19 @@ test_signal_handlers = IOTestCase "signal_handlers" [] $ \wrapInterp -> do
396
396
return r
397
397
#endif
398
398
399
+ test_error_capture :: IOTestCase
400
+ test_error_capture = IOTestCase " error_capture" [mod_file] $ \ wrapInterp-> do
401
+ liftIO $ writeFile mod_file " $"
402
+ r <- wrapInterp runInterpreter $ do
403
+ loadModules [mod_file]
404
+ case r of
405
+ Right () -> assertFailure " Loaded invalid file"
406
+ Left (WontCompile _) -> pure $ Right ()
407
+ Left e -> assertFailure $ " Got other than WontCompiler error: " ++ show e
408
+
409
+ where mod_name = " TEST_ErrorCapture"
410
+ mod_file = mod_name ++ " .hs"
411
+
399
412
tests :: [TestCase ]
400
413
tests = [test_reload_modified
401
414
,test_lang_exts
@@ -422,6 +435,7 @@ tests = [test_reload_modified
422
435
ioTests :: [IOTestCase ]
423
436
ioTests = [test_signal_handlers
424
437
,test_package_db
438
+ ,test_error_capture
425
439
]
426
440
427
441
main :: IO ()
You can’t perform that action at this time.
0 commit comments