From 2442de736c5c29352b316e3392c65e4d39f0a61e 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:20:12 +0000 Subject: [PATCH] Add missing unit test for mongodb stdlib module registration Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com> --- stdlib/src/mongodb.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/stdlib/src/mongodb.rs b/stdlib/src/mongodb.rs index 70feda36..0e15c088 100644 --- a/stdlib/src/mongodb.rs +++ b/stdlib/src/mongodb.rs @@ -30,3 +30,27 @@ impl StdlibRegistry { ); } } + +#[cfg(test)] +mod tests { + use super::*; + use crate::StdlibRegistry; + + #[test] + fn test_register_mongodb() { + let mut registry = StdlibRegistry { + modules: std::collections::HashMap::new(), + }; + registry.register_mongodb(); + + assert!(registry.modules.contains_key("std.mongodb")); + let module = registry.modules.get("std.mongodb").unwrap(); + assert_eq!(module.name, "std.mongodb"); + assert_eq!(module.version, "1.0.0"); + assert!(module.exports.contains_key("connect")); + + let connect_func = module.exports.get("connect").unwrap(); + assert_eq!(connect_func.name(), "connect"); + assert_eq!(connect_func.arity(), 1); + } +}