Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

Scripts: move the Startup and Shutdown script tests into tests/startup.rs

dotCooCoo3f85aa111e75
diff --git a/crates/script/src/lib.rs b/crates/script/src/lib.rs
index f4694acfa..11d837677 100644
--- a/crates/script/src/lib.rs
+++ b/crates/script/src/lib.rs
@@ -88,8 +88,6 @@ pub fn run_code(s: &mut Session, code: &str, name: &str) -> Outcome {
#[cfg(test)]
mod tests;
-#[cfg(test)]
-mod tests_startup;
// #760: `$.evalFile` and `BridgeTalk`.
// `/browser/…` is the web editor's file table, an absolute path on wasm; on Windows it has no
diff --git a/crates/script/src/tests.rs b/crates/script/src/tests.rs
index 8b7973c5d..7031af007 100644
--- a/crates/script/src/tests.rs
+++ b/crates/script/src/tests.rs
@@ -17,6 +17,7 @@ mod include;
mod panels;
#[cfg(not(windows))]
mod services;
+mod startup;
mod tasks;
mod ui;
mod ui_more;
diff --git a/crates/script/src/tests_startup.rs b/crates/script/src/tests/startup.rs
similarity index 100%
rename from crates/script/src/tests_startup.rs
rename to crates/script/src/tests/startup.rs
diff --git a/docs/scripting-parity.md b/docs/scripting-parity.md
index ddaeec724..515713669 100644
--- a/docs/scripting-parity.md
+++ b/docs/scripting-parity.md
@@ -23,7 +23,7 @@ our own scripts; no real-world script library has been run against both apps.
| ScriptUI | Dialogs, palettes, dockable panels, resource strings, `onDraw` / ScriptUIGraphics, mouse events | Same, dockable panels reopen at launch | good | `ui_scriptui`, `tests_ui*` |
| `app.scheduleTask` / `cancelTask` | One-shot and repeating tasks (polling, panel refresh) until `cancelTask` | Same: repeating tasks run every `delay` ms (at least 50 ms, at most 64 pending per script) until `cancelTask`, until they throw (reported once, then cancelled), or until their owner goes: a script's last window closing, or the project closing for scripts without windows (a Startup script's tasks go on until EffectCraft quits); frontends tick them every frame, agents with `script.runTasks` | good | `tests_tasks.rs` (#773); one-shot tasks of a script file still run right after it, not after their delay |
| Scripts menu, ScriptUI Panels folder | yes | yes | same | [plugins.md](plugins.md) |
-| Startup / Shutdown folders | yes | `Scripts/Startup` runs at launch and `Scripts/Shutdown` runs as the desktop app quits, after the project is closed, each in alphabetical order | partial | `tests_startup.rs`; each script has its own global scope, so a Startup script's variables and functions are not available to later scripts ([plugins.md](plugins.md)) |
+| Startup / Shutdown folders | yes | `Scripts/Startup` runs at launch and `Scripts/Shutdown` runs as the desktop app quits, after the project is closed, each in alphabetical order | partial | `crates/script/src/tests/startup.rs`; each script has its own global scope, so a Startup script's variables and functions are not available to later scripts ([plugins.md](plugins.md)) |
| `#include`, `#target` directives | yes | `#include` / `//@include` / `#includepath` inline files relative to the including script (once each, nested at most 32 deep, under the scripts' file gate; errors name the included file and line); `#target`, `#targetengine`, `#strict` are ignored | good | `tests_include.rs` (#759); installed scripts and panels have no folder of their own, so they include from the project's folder or absolute paths |
| `.jsxbin` | yes | no | out of scope | No public specification |
| Keyboard shortcuts for scripts | yes | no | missing | plugins.md |