fn generate(&self) -> Vec<PrefilterTest> {
            let mut tests = vec![];
            let mut push = |test: Option<PrefilterTest>| {
                if let Some(test) = test {
                    tests.push(test);
                }
            };
            let len_start = 2;
            // The loop below generates *a lot* of tests. The number of tests
            // was chosen somewhat empirically to be "bearable" when running
            // the test suite.
            for needle_len in len_start..=40 {
                let rare_start = len_start - 1;
                for rare1i in rare_start..needle_len {
                    for rare2i in rare1i..needle_len {
                        for haystack_len in needle_len..=66 {
                            push(PrefilterTest::new(
                                self,
                                rare1i,
                                rare2i,
                                haystack_len,
                                needle_len,
                                None,
                            ));
                            // Test all possible match scenarios for this
                            // needle and haystack.
                            for output in 0..=(haystack_len - needle_len) {
                                push(PrefilterTest::new(
                                    self,
                                    rare1i,
                                    rare2i,
                                    haystack_len,
                                    needle_len,
                                    Some(output),
                                ));
                            }
                        }
                    }
                }
            }
            tests
        }
/// Generate a series of prefilter tests from this seed.
Generate a series of prefilter tests from this seed.
Generate a series of prefilter tests from this seed .
fn generate(&self) -> Vec<PrefilterTest> {
            let mut tests = vec![];
            let mut push = |test: Option<PrefilterTest>| {
                if let Some(test) = test {
                    tests.push(test);
                }
            };
            let len_start = 2;
            // The loop below generates *a lot* of tests. The number of tests
            // was chosen somewhat empirically to be "bearable" when running
            // the test suite.
            for needle_len in len_start..=40 {
                let rare_start = len_start - 1;
                for rare1i in rare_start..needle_len {
                    for rare2i in rare1i..needle_len {
                        for haystack_len in needle_len..=66 {
                            push(PrefilterTest::new(
                                self,
                                rare1i,
                                rare2i,
                                haystack_len,
                                needle_len,
                                None,
                            ));
                            // Test all possible match scenarios for this
                            // needle and haystack.
                            for output in 0..=(haystack_len - needle_len) {
                                push(PrefilterTest::new(
                                    self,
                                    rare1i,
                                    rare2i,
                                    haystack_len,
                                    needle_len,
                                    Some(output),
                                ));
                            }
                        }
                    }
                }
            }
            tests
        }
fn generate ( & self ) -> Vec < PrefilterTest > { let mut tests = vec ! [ ] ; let mut push = | test : Option < PrefilterTest > | { if let Some ( test ) = test { tests . push ( test ) ; } } ; let len_start = 2 ; // The loop below generates *a lot* of tests. The number of tests // was chosen somewhat empirically to be "bearable" when running // the test suite. for needle_len in len_start ..= 40 { let rare_start = len_start - 1 ; for rare1i in rare_start .. needle_len { for rare2i in rare1i .. needle_len { for haystack_len in needle_len ..= 66 { push ( PrefilterTest :: new ( self , rare1i , rare2i , haystack_len , needle_len , None , ) ) ; // Test all possible match scenarios for this // needle and haystack. for output in 0 ..= ( haystack_len - needle_len ) { push ( PrefilterTest :: new ( self , rare1i , rare2i , haystack_len , needle_len , Some ( output ) , ) ) ; } } } } } tests }
Generate a series of prefilter tests from this seed.
Generate a series of prefilter tests from this seed .
&self
&self