Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #324 from KodrAus/feat/arbitrary
Add support for arbitrary
- Loading branch information
Showing
5 changed files
with
74 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use arbitrary::Arbitrary; | ||
|
||
bitflags! { | ||
#[derive(Arbitrary)] | ||
struct Color: u32 { | ||
const RED = 0x1; | ||
const GREEN = 0x2; | ||
const BLUE = 0x4; | ||
} | ||
} | ||
|
||
#[test] | ||
fn test_arbitrary() { | ||
let mut unstructured = arbitrary::Unstructured::new(&[0_u8; 256]); | ||
let _color = Color::arbitrary(&mut unstructured); | ||
} | ||
} |
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