git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commitd9b03017252bd294d9b76e2975e29e2afa254d80
parent26f08b86d3
authorLucas Galante <[email protected]>
date2026-09-01 22:44
backend: gate near_roll_fallback_tests on debug_assertions too

near_roll_fallback_reason is #[cfg(debug_assertions)], but its test module
was only #[cfg(test)], so `cargo test --release -p cce-ui` failed with E0432
on the import. The tests now compile out alongside the function.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/backend/window_runner.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/backend/window_runner.rs b/src/backend/window_runner.rs
index 6327f93..6c95679 100644
--- a/src/backend/window_runner.rs
+++ b/src/backend/window_runner.rs
@@ -5748,7 +5748,9 @@ fn run_session<'l, A: Application>(
     (app, end)
 }
 
-#[cfg(test)]
+// `all(test, debug_assertions)`: the function under test only exists in
+// debug builds, so a `cargo test --release` must compile the module out too.
+#[cfg(all(test, debug_assertions))]
 mod near_roll_fallback_tests {
     use super::near_roll_fallback_reason;
     use crate::scene::layout::Rect;