diff --git a/core/src/value/module.rs b/core/src/value/module.rs index 6172ad11..6fcabb9e 100644 --- a/core/src/value/module.rs +++ b/core/src/value/module.rs @@ -573,28 +573,13 @@ mod test { assert_eq!(module.name::().unwrap(), "Test"); let _ = module.meta::().unwrap(); - let names = module - .namespace() - .unwrap() - .keys() - .collect::>>() - .unwrap(); - - assert_eq!(names[0], "a"); - assert_eq!(names[1], "foo"); - assert_eq!(names[2], "Baz"); + let ns = module.namespace().unwrap(); - let entries = module - .namespace() - .unwrap() - .props() - .collect::>>() - .unwrap(); + assert!(ns.contains_key("a").unwrap()); + assert!(ns.contains_key("foo").unwrap()); + assert!(ns.contains_key("Baz").unwrap()); - assert_eq!(entries[0].0, "a"); - assert_eq!(i32::from_js(&ctx, entries[0].1.clone()).unwrap(), 2); - assert_eq!(entries[1].0, "foo"); - assert_eq!(entries[2].0, "Baz"); + assert_eq!(ns.get::<_, u32>("a").unwrap(), 2u32); }); } }