diff --git a/examples/threads/threads.txs b/examples/threads/threads.txs index 7396bb40..96d5b7db 100644 --- a/examples/threads/threads.txs +++ b/examples/threads/threads.txs @@ -6,12 +6,12 @@ spawn_fn = thread["spawn"] join_fn = thread["join"] do task_a() - time.sleep(100) + time.sleep(200) say "Task A completed on worker thread." end do task_b() - time.sleep(50) + time.sleep(20) say "Task B completed on worker thread." end diff --git a/stdlib/src/docs.rs b/stdlib/src/docs.rs index 1ab97221..bb5bd729 100644 --- a/stdlib/src/docs.rs +++ b/stdlib/src/docs.rs @@ -19,3 +19,21 @@ impl StdlibRegistry { ); } } + +#[cfg(test)] +mod tests { + use super::*; + use crate::StdlibRegistry; + + #[test] + fn test_register_docs() { + let registry = StdlibRegistry::new(); + let module = registry + .get_module("std.docs") + .expect("std.docs module should be registered"); + + assert_eq!(module.name, "std.docs"); + assert_eq!(module.version, "1.0.0"); + assert!(module.required_capabilities.is_empty()); + } +} diff --git a/stdlib/tests/stdlib_tests.rs b/stdlib/tests/stdlib_tests.rs index 05c13a8c..be2034df 100644 --- a/stdlib/tests/stdlib_tests.rs +++ b/stdlib/tests/stdlib_tests.rs @@ -1331,3 +1331,15 @@ fn test_uuid_module() { assert!(!uuid_str.is_empty()); assert!(uuid_str.contains("-")); } + +#[test] +fn test_docs_module() { + let registry = StdlibRegistry::new(); + let docs = registry + .get_module("std.docs") + .expect("std.docs module should be registered"); + + assert_eq!(docs.name, "std.docs"); + assert_eq!(docs.version, "1.0.0"); + assert!(docs.required_capabilities.is_empty()); +}