v0.0.0b
This commit is contained in:
21
x/tests/test_core.rs
Normal file
21
x/tests/test_core.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
#[test]
|
||||
pub fn test_once() {
|
||||
let mut i = 0;
|
||||
for _ in 0..3 {
|
||||
if x::once!() { i+= 1; }
|
||||
if x::once!() { i+= 1; }
|
||||
}
|
||||
assert_eq!(i, 2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#[test]
|
||||
pub fn test_chain() {
|
||||
let a = 0x1337;
|
||||
let b = [None,None,Some(&a)];
|
||||
let c = [None,Some(&b), None];
|
||||
assert_eq!(0x1337, x::ptr_chain!(&c as *const _, 0x8, 0x10, 0x0));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user