File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -495,6 +495,19 @@ test_signal_handlers = IOTestCase "signal_handlers" [] $ \wrapInterp -> do
495495 return r
496496#endif
497497
498+ test_error_capture :: IOTestCase
499+ test_error_capture = IOTestCase " error_capture" [mod_file] $ \ wrapInterp-> do
500+ liftIO $ writeFile mod_file " $"
501+ r <- wrapInterp runInterpreter $ do
502+ loadModules [mod_file]
503+ case r of
504+ Right () -> assertFailure " Loaded invalid file"
505+ Left (WontCompile _) -> pure $ Right ()
506+ Left e -> assertFailure $ " Got other than WontCompiler error: " ++ show e
507+
508+ where mod_name = " TEST_ErrorCapture"
509+ mod_file = mod_name ++ " .hs"
510+
498511tests :: [TestCase ]
499512tests = [test_reload_modified
500513 ,test_lang_exts
@@ -522,6 +535,7 @@ ioTests :: [IOTestCase]
522535ioTests = [test_signal_handlers
523536 ,test_package_db
524537 ,test_ghc_environment_file
538+ ,test_error_capture
525539 ]
526540
527541main :: IO ()
You can’t perform that action at this time.
0 commit comments