From f80c35878d31f88773deec4cc725de08a2ca9f52 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 08:30:53 +0000 Subject: [PATCH] Add test for notification module registration Added a unit test `test_register_notification` to verify that the `std.notification` module is correctly registered in the standard library registry. The test ensures that the module is successfully added, its exports are correctly populated, and the `show` and `alert` functions have the expected names and arities. Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com> --- stdlib/src/notification.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/stdlib/src/notification.rs b/stdlib/src/notification.rs index 07e07b65..2288fad0 100644 --- a/stdlib/src/notification.rs +++ b/stdlib/src/notification.rs @@ -74,3 +74,29 @@ impl StdlibRegistry { ); } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_register_notification() { + let mut registry = StdlibRegistry { + modules: std::collections::HashMap::new(), + }; + registry.register_notification(); + + assert!(registry.has_module("std.notification")); + + let module = registry.get_module("std.notification").unwrap(); + assert_eq!(module.name, "std.notification"); + + let show = module.exports.get("show").unwrap(); + assert_eq!(show.name(), "show"); + assert_eq!(show.arity(), 2); + + let alert = module.exports.get("alert").unwrap(); + assert_eq!(alert.name(), "alert"); + assert_eq!(alert.arity(), 1); + } +}