diff --git a/stdlib/src/barcode.rs b/stdlib/src/barcode.rs index 268534da..6cb8f87d 100644 --- a/stdlib/src/barcode.rs +++ b/stdlib/src/barcode.rs @@ -19,3 +19,23 @@ impl StdlibRegistry { ); } } + +#[cfg(test)] +mod tests { + use super::*; + use crate::StdlibRegistry; + + #[test] + fn test_register_barcode() { + let mut registry = StdlibRegistry::new(); + // Since `StdlibRegistry::new()` calls `register_defaults()`, which calls `register_barcode()`, + // the module should already be registered. + + let module = registry + .get_module("std.barcode") + .expect("Module should be registered"); + assert_eq!(module.name, "std.barcode"); + assert_eq!(module.version, "1.0.0"); + assert_eq!(module.required_capabilities.len(), 0); + } +}