From ac128483c6901e740c9def5634d13b8e21f9d26e 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:21:45 +0000 Subject: [PATCH] Add test for module registration in csv.rs Added a unit test `test_register_csv` to `stdlib/src/csv.rs` to ensure the `std.csv` module is correctly registered in the standard library registry, filling a testing gap. Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com> --- stdlib/src/csv.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/stdlib/src/csv.rs b/stdlib/src/csv.rs index aac9fcef..d910082d 100644 --- a/stdlib/src/csv.rs +++ b/stdlib/src/csv.rs @@ -73,3 +73,26 @@ impl StdlibRegistry { ); } } + +#[cfg(test)] +mod tests { + use super::*; + use std::collections::HashMap; + + #[test] + fn test_register_csv() { + let mut registry = StdlibRegistry { + modules: HashMap::new(), + }; + + registry.register_csv(); + + assert!(registry.has_module("std.csv")); + + let module = registry.get_module("std.csv").unwrap(); + assert_eq!(module.name, "std.csv"); + assert_eq!(module.version, "1.0.0"); + assert!(module.exports.contains_key("parse")); + assert!(module.exports.contains_key("stringify")); + } +}