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 @@ -495,6 +495,19 @@ test_signal_handlers = IOTestCase "signal_handlers" [] $ \wrapInterp -> do
495
495
return r
496
496
#endif
497
497
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
+
498
511
tests :: [TestCase ]
499
512
tests = [test_reload_modified
500
513
,test_lang_exts
@@ -522,6 +535,7 @@ ioTests :: [IOTestCase]
522
535
ioTests = [test_signal_handlers
523
536
,test_package_db
524
537
,test_ghc_environment_file
538
+ ,test_error_capture
525
539
]
526
540
527
541
main :: IO ()
You can’t perform that action at this time.
0 commit comments