Skip to content

Commit

Permalink
Reformat quickcheck blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom Chiovoloni committed Jul 20, 2019
1 parent f80225d commit 1ada969
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions src/byteset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,33 @@ pub(crate) fn rfind_not(haystack: &[u8], byteset: &[u8]) -> Option<usize> {
mod tests {

quickcheck! {
fn qc_byteset_forward_matches_naive(haystack: Vec<u8>, needles: Vec<u8>) -> bool {
super::find(&haystack, &needles) == haystack.iter().position(|b| needles.contains(b))
fn qc_byteset_forward_matches_naive(
haystack: Vec<u8>,
needles: Vec<u8>
) -> bool {
super::find(&haystack, &needles)
== haystack.iter().position(|b| needles.contains(b))
}
fn qc_byteset_backwards_matches_naive(haystack: Vec<u8>, needles: Vec<u8>) -> bool {
super::rfind(&haystack, &needles) == haystack.iter().rposition(|b| needles.contains(b))
fn qc_byteset_backwards_matches_naive(
haystack: Vec<u8>,
needles: Vec<u8>
) -> bool {
super::rfind(&haystack, &needles)
== haystack.iter().rposition(|b| needles.contains(b))
}
fn qc_byteset_forward_not_matches_naive(haystack: Vec<u8>, needles: Vec<u8>) -> bool {
super::find_not(&haystack, &needles) == haystack.iter().position(|b| !needles.contains(b))
fn qc_byteset_forward_not_matches_naive(
haystack: Vec<u8>,
needles: Vec<u8>
) -> bool {
super::find_not(&haystack, &needles)
== haystack.iter().position(|b| !needles.contains(b))
}
fn qc_byteset_backwards_not_matches_naive(haystack: Vec<u8>, needles: Vec<u8>) -> bool {
super::rfind_not(&haystack, &needles) == haystack.iter().rposition(|b| !needles.contains(b))
fn qc_byteset_backwards_not_matches_naive(
haystack: Vec<u8>,
needles: Vec<u8>
) -> bool {
super::rfind_not(&haystack, &needles)
== haystack.iter().rposition(|b| !needles.contains(b))
}
}
}

0 comments on commit 1ada969

Please sign in to comment.