From 01f53e7d78b55bab7f848a4e5702201537de6f9e 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:18:20 +0000 Subject: [PATCH] test: Add unit test for FTP module registration Adds a missing test module in `stdlib/src/ftp.rs` to verify the successful registration of the `std.ftp` module. The test ensures that `StdlibRegistry::register_ftp` properly populates the registry mapping with expected metadata (name, version) and its corresponding exports such as the 'connect' dummy function. Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com> --- stdlib/src/ftp.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/stdlib/src/ftp.rs b/stdlib/src/ftp.rs index e7f2e885..c9abb7f9 100644 --- a/stdlib/src/ftp.rs +++ b/stdlib/src/ftp.rs @@ -28,3 +28,24 @@ impl StdlibRegistry { ); } } + +#[cfg(test)] +mod tests { + use super::*; + use crate::StdlibRegistry; + use std::collections::HashMap; + + #[test] + fn test_register_ftp() { + let mut registry = StdlibRegistry { + modules: HashMap::new(), + }; + registry.register_ftp(); + + assert!(registry.has_module("std.ftp")); + let module = registry.get_module("std.ftp").unwrap(); + assert_eq!(module.name, "std.ftp"); + assert_eq!(module.version, "1.0.0"); + assert!(module.exports.contains_key("connect")); + } +}