diff --git a/crates/engine/src/tests/script_palettes.rs b/crates/engine/src/tests/script_palettes.rs index 77d653c162..a522a0468f 100644 --- a/crates/engine/src/tests/script_palettes.rs +++ b/crates/engine/src/tests/script_palettes.rs @@ -695,8 +695,8 @@ fn a_handler_that_update_runs_plays_the_actions_of_the_run_that_showed_its_palet let before = objects(&s); assert_eq!(s.script_palette_event(id, UiEvent::Click(1)), Ok(Waiting::Added)); // A later run of the engine, given no actions, takes the click in its update(). - let log = run(&mut s, "#targetengine acts\np.update(); try { app.doScript('Box', 'Set'); } catch (e) { vc.log(e.message); }").unwrap()["log"] - .clone(); + let log = + run(&mut s, "#targetengine acts\np.update(); try { app.doScript('Box', 'Set'); } catch (e) { vc.log(e.message); }").unwrap()["log"].clone(); assert_eq!(log, json!(["played", "there is no action set “Set”"]), "the run's own call plays the run's own actions"); assert_eq!(objects(&s), before + 1, "the handler's action drew its rectangle"); } diff --git a/crates/js/src/scriptui_tests.rs b/crates/js/src/scriptui_tests.rs index 72ec393c9f..edd5c1121a 100644 --- a/crates/js/src/scriptui_tests.rs +++ b/crates/js/src/scriptui_tests.rs @@ -872,8 +872,10 @@ fn a_palette_list_change_throws_when_an_item_s_text_comes_from_a_getter() { #[test] fn update_asks_the_host_once_more_after_a_handler_s_exception() { let (mut r, calls) = palette_realm_with(Vec::new(), vec![palette_event(1.0, click(1))], Vec::new()); - r.run("var p = new Window('palette'); var b = p.add('button', undefined, 'Go'); b.onClick = function () { throw new Error('broken'); }; p.show();") - .unwrap(); + r.run( + "var p = new Window('palette'); var b = p.add('button', undefined, 'Go'); b.onClick = function () { throw new Error('broken'); }; p.show();", + ) + .unwrap(); let thrown = r.run("try { p.update(); 'none'; } catch (e) { e.message; }").unwrap(); assert_eq!(thrown, JsValue::String("broken".into())); let asked: Vec = names(&calls).into_iter().filter(|n| n == "palettePending" || n == "paletteTake").collect();