2 parents a3155f2 + 9423679 commit 62537d6Copy full SHA for 62537d6
1 file changed
runtime/interpreter/tests/interpreter_tests.rs
@@ -194,6 +194,21 @@ try {
194
assert_eq!(val, RuntimeValue::Str("critical exception".to_string()));
195
}
196
197
+#[test]
198
+fn test_interpreter_uncaught_throw() {
199
+ let source = r#"
200
+throw "uncaught exception"
201
+"#;
202
+ let res = run_source(source);
203
+ assert!(res.is_err());
204
+ let err = res.unwrap_err();
205
+ assert_eq!(err.message, "uncaught exception");
206
+ match err.kind {
207
+ RuntimeErrorKind::UserError(msg) => assert_eq!(msg, "uncaught exception"),
208
+ _ => panic!("Expected UserError"),
209
+ }
210
+}
211
+
212
#[test]
213
fn test_v108_runtime_compatibility() {
214
let source = r#"
0 commit comments