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 223
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
90887c2
commit d2b85e9
Showing
7 changed files
with
82 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,19 @@ | ||
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; | ||
|
||
proptest! { | ||
#![proptest_config(ProptestConfig { | ||
source_file: None, .. ProptestConfig::default() | ||
})] | ||
|
||
let bitmap: Bitmap = iter.collect(); | ||
let expected: Bitmap = iter_not.collect(); | ||
/// Asserts that !bitmap equals all bits flipped | ||
#[test] | ||
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