1
0
Fork 0
forked from wry/wry

workspace: move crates under crates

This commit is contained in:
kossLAN 2026-05-29 18:55:59 -04:00
parent 0016bc8cf0
commit 6393fdf3c0
No known key found for this signature in database
354 changed files with 102 additions and 102 deletions

View file

@ -0,0 +1,40 @@
use crate::free_list::FreeList;
#[test]
fn test() {
let list = FreeList::<u32, 3>::default();
for i in 0..4097 {
assert_eq!(list.acquire(), i);
}
list.release(100);
assert_eq!(list.acquire(), 100);
assert_eq!(list.acquire(), 4097);
for i in 1..22 {
list.release(i);
}
for i in 1..22 {
assert_eq!(list.acquire(), i);
}
assert_eq!(list.acquire(), 4098);
for i in 64..128 {
list.release(i);
}
for i in 64..128 {
assert_eq!(list.acquire(), i);
}
assert_eq!(list.acquire(), 4099);
for i in 0..4100 {
list.release(i);
}
for i in 0..4101 {
assert_eq!(list.acquire(), i);
}
}
#[test]
#[should_panic]
fn release_out_of_bounds() {
let list = FreeList::<u32, 3>::default();
list.acquire();
list.release(500);
}