Skip to content

Commit f798887

Browse files
Add test for PDF module registration
Added a test case for `register_pdf` in `stdlib/src/pdf.rs` to ensure the module is registered properly with the expected metadata (name, version, empty capabilities and exports). Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com>
1 parent 514e6c0 commit f798887

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎stdlib/src/pdf.rs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,21 @@ impl StdlibRegistry {
1919
);
2020
}
2121
}
22+
23+
#[cfg(test)]
24+
mod tests {
25+
use super::*;
26+
27+
#[test]
28+
fn test_register_pdf() {
29+
let mut registry = StdlibRegistry::default();
30+
registry.register_pdf();
31+
32+
assert!(registry.has_module("std.pdf"));
33+
let module = registry.get_module("std.pdf").unwrap();
34+
assert_eq!(module.name, "std.pdf");
35+
assert_eq!(module.version, "1.0.0");
36+
assert!(module.exports.is_empty());
37+
assert!(module.required_capabilities.is_empty());
38+
}
39+
}

0 commit comments

Comments
 (0)