mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-26 18:18:35 +00:00
Tests: the script corpus failure test reads an undefined name
Scripts now have an app object, so app.activeDocument no longer throws a ReferenceError. The test reads a name the host does not define instead.
This commit is contained in:
@@ -89,9 +89,9 @@ fn a_script_that_ends_well_passes() {
|
||||
fn a_failure_gives_its_kind_and_place() {
|
||||
let r = result(&mut session(), &source("var a = 1;\nvar = ;"));
|
||||
assert_eq!((r["ok"].clone(), r["kind"].clone(), r["line"].clone()), (json!(false), json!("syntax"), json!(2)));
|
||||
let r = result(&mut session(), &source("var d = app.activeDocument;"));
|
||||
let r = result(&mut session(), &source("var d = undefinedHost.activeDocument;"));
|
||||
assert_eq!(r["kind"], "thrown");
|
||||
assert!(r["message"].as_str().unwrap().starts_with("ReferenceError: app"), "{r}");
|
||||
assert!(r["message"].as_str().unwrap().starts_with("ReferenceError: undefinedHost"), "{r}");
|
||||
let r = result(&mut session(), &source("while (true) {}"));
|
||||
assert_eq!(r["kind"], "limit");
|
||||
assert!(r["fuelUsed"].as_u64().unwrap() <= FUEL);
|
||||
|
||||
Reference in New Issue
Block a user