Scripts: script code builds with main's revert test and command hook

main added a test named wrappers_go_stale_after_revert and passes the
command id to dom::before_command by reference.

- The revert test of this branch is renamed
  objects_read_before_a_revert_are_stale_and_ones_read_after_are_the_loaded_ones.
- command_value takes `id` as a &str, so the call passes it as it is,
  which clippy's needless_borrow check requires.
This commit is contained in:
dotCooCoo committed 2026-11-28 00:09:25 -08:00
1 parent e75b26cffc
commit eb4c8bdc81
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1366,7 +1366,7 @@ fn command(host: &Host, id: &str, params: &Value) -> std::result::Result<Data, H
fn command_value(host: &Host, id: &str, params: &Value) -> std::result::Result<(Data, Value), HostError> {
let session = host.session.clone();
let started = clock();
let before = dom::before_command(host, &id);
let before = dom::before_command(host, id);
let r = {
let mut s = session.borrow_mut();
step(&mut s, host, id, params)
+1 -1
View File
@@ -1391,7 +1391,7 @@ fn wrappers_go_stale_after_delete_and_undo() {
/// File › Revert loads objects with the ids they were saved with: an object or a layer read before
/// the revert does not name the loaded one.
#[test]
fn wrappers_go_stale_after_revert() {
fn objects_read_before_a_revert_are_stale_and_ones_read_after_are_the_loaded_ones() {
// `pageItems[0]` is the topmost object, the one made last.
let (mut s, _, b) = doc();
let dir = std::env::temp_dir().join(format!("vc-dom-revert-{}", std::process::id()));