This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f3d76c
commit fedb19f
Showing
7 changed files
with
73 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
use proptest::prelude::*; | ||
|
||
use arrow2::bitmap::Bitmap; | ||
|
||
#[test] | ||
fn not_random() { | ||
let iter = (0..100).map(|x| x % 7 == 0); | ||
let iter_not = iter.clone().map(|x| !x); | ||
use crate::bitmap::bitmap_strategy; | ||
|
||
let bitmap: Bitmap = iter.collect(); | ||
let expected: Bitmap = iter_not.collect(); | ||
proptest! { | ||
/// Asserts that !bitmap equals all bits flipped | ||
#[test] | ||
#[cfg_attr(miri, ignore)] // miri and proptest do not work well :( | ||
fn not(bitmap in bitmap_strategy()) { | ||
let not_bitmap: Bitmap = bitmap.iter().map(|x| !x).collect(); | ||
|
||
assert_eq!(!&bitmap, expected); | ||
assert_eq!(!&bitmap, not_bitmap); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters