Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions stdlib/tests/stdlib_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,30 @@ fn test_math_module() {
assert_ne!(r1, r2); // pseudo-random sequence should advance
}

#[test]
fn test_math_module_registration() {
let mut registry = StdlibRegistry::new();
registry.register_math();

let math = registry.get_module("std.math").unwrap();
assert_eq!(math.name, "std.math");
assert_eq!(math.version, "1.0.0");
assert!(math.required_capabilities.is_empty());

let expected_exports = vec![
"abs", "sin", "cos", "tan", "log", "exp", "sqrt", "pow", "floor", "ceil", "round",
"random", "to_float",
];

for name in expected_exports {
assert!(
math.exports.contains_key(name),
"math module should export {}",
name
);
}
}

#[test]
fn test_strings_module() {
let registry = StdlibRegistry::new();
Expand Down
Loading