use dmv::*; #[test] fn test_multi_scope() { scope!(pub Scope1); scope!(pub Scope2); Dmv.init::(1); Dmv.init::(1); let s1_id1 = Dmv.register::().unwrap(); let s1_id2 = Dmv.register::().unwrap(); assert_ne!(s1_id1, s1_id2); let s2_id1 = Dmv.register::().unwrap(); let s2_id2 = Dmv.register::().unwrap(); assert_ne!(s2_id1, s2_id2); assert_eq!(*s1_id1.handle(), *s2_id1.handle()); assert_eq!(*s1_id2.handle(), *s2_id2.handle()); } #[test] fn test_handle() { let id = Dmv.register::().unwrap(); { let h1 = id.handle(); let h2 = id.handle(); assert_eq!(*h1, *h2); } }