Skip to content

Commit

Permalink
Run test-list-collisions in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tomerfiliba committed Aug 16, 2024
1 parent 3774001 commit e5263db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ jobs:
run: cargo -Z unstable-options -C candy-longliving run --release -- 10 40001 10000
- name: Run mini-candy
run: cargo -Z unstable-options -C mini-candy run
- name: Run test-list-collisions
run: cargo -Z unstable-options -C test-list-collisions run --release
8 changes: 4 additions & 4 deletions test-list-collisions/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ fn main() -> Result<()> {
// force many elements to end up with the same PartedHash
unsafe { HASH_BITS_TO_KEEP = 0xf000_000f_0000_00ff };

for i in 0u32..10000 {
for i in 0u32..100_000 {
//println!("push {i}");
db.push_to_list_tail("xxx", &i.to_le_bytes())?;
}

for i in 0u32..10000 {
for i in 0u32..100_000 {
//println!("pop {i}");
assert_eq!(db.pop_list_head("xxx")?.unwrap().1, &i.to_le_bytes());
}

assert!(db.pop_list_head("xxx")?.is_none());

for i in 0u32..10000 {
for i in 0u32..100_000 {
//println!("push {i}");
db.push_to_list_head("xxx", &i.to_le_bytes())?;
}

for i in 0u32..10000 {
for i in 0u32..100_000 {
//println!("pop {i}");
assert_eq!(db.pop_list_tail("xxx")?.unwrap().1, &i.to_le_bytes());
}
Expand Down

0 comments on commit e5263db

Please sign in to comment.