Skip to content

Commit 4136588

Browse files
🧪 Add unit test for std.sqlite registration
Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com>
1 parent dddc025 commit 4136588

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎stdlib/src/sqlite.rs‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,27 @@ impl StdlibRegistry {
284284
);
285285
}
286286
}
287+
288+
#[cfg(test)]
289+
mod tests {
290+
use super::*;
291+
use crate::StdlibRegistry;
292+
293+
#[test]
294+
fn test_register_sqlite() {
295+
let registry = StdlibRegistry::new();
296+
297+
let module = registry
298+
.get_module("std.sqlite")
299+
.expect("std.sqlite module should be registered");
300+
assert_eq!(module.name, "std.sqlite");
301+
assert_eq!(module.version, "1.0.0");
302+
assert!(module.required_capabilities.is_empty());
303+
304+
assert!(module.exports.contains_key("open"));
305+
assert!(module.exports.contains_key("execute"));
306+
assert!(module.exports.contains_key("query"));
307+
assert!(module.exports.contains_key("close"));
308+
assert_eq!(module.exports.len(), 4);
309+
}
310+
}

0 commit comments

Comments
 (0)