This commit is contained in:
Intege-rs
2024-11-13 21:41:26 -05:00
commit 03066e2e55
29 changed files with 1549 additions and 0 deletions

21
x/tests/test_core.rs Normal file
View 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));
}