]>
git.proxmox.com Git - cargo.git/blob - vendor/memchr/src/tests/memchr/memchr.rs
1 use quickcheck
::quickcheck
;
5 memchr
::{fallback, naive}
,
6 memchr2
, memchr3
, memrchr
, memrchr2
, memrchr3
,
7 tests
::memchr
::testdata
::memchr_tests
,
12 for test
in memchr_tests() {
13 test
.one(false, memchr
);
18 fn memchr1_fallback_find() {
19 for test
in memchr_tests() {
20 test
.one(false, fallback
::memchr
);
26 for test
in memchr_tests() {
27 test
.two(false, memchr2
);
32 fn memchr2_fallback_find() {
33 for test
in memchr_tests() {
34 test
.two(false, fallback
::memchr2
);
40 for test
in memchr_tests() {
41 test
.three(false, memchr3
);
46 fn memchr3_fallback_find() {
47 for test
in memchr_tests() {
48 test
.three(false, fallback
::memchr3
);
54 for test
in memchr_tests() {
55 test
.one(true, memrchr
);
60 fn memrchr1_fallback_find() {
61 for test
in memchr_tests() {
62 test
.one(true, fallback
::memrchr
);
68 for test
in memchr_tests() {
69 test
.two(true, memrchr2
);
74 fn memrchr2_fallback_find() {
75 for test
in memchr_tests() {
76 test
.two(true, fallback
::memrchr2
);
82 for test
in memchr_tests() {
83 test
.three(true, memrchr3
);
88 fn memrchr3_fallback_find() {
89 for test
in memchr_tests() {
90 test
.three(true, fallback
::memrchr3
);
95 fn qc_memchr1_matches_naive(n1
: u8, corpus
: Vec
<u8>) -> bool
{
96 memchr(n1
, &corpus
) == naive
::memchr(n1
, &corpus
)
101 fn qc_memchr2_matches_naive(n1
: u8, n2
: u8, corpus
: Vec
<u8>) -> bool
{
102 memchr2(n1
, n2
, &corpus
) == naive
::memchr2(n1
, n2
, &corpus
)
107 fn qc_memchr3_matches_naive(
108 n1
: u8, n2
: u8, n3
: u8,
111 memchr3(n1
, n2
, n3
, &corpus
) == naive
::memchr3(n1
, n2
, n3
, &corpus
)
116 fn qc_memrchr1_matches_naive(n1
: u8, corpus
: Vec
<u8>) -> bool
{
117 memrchr(n1
, &corpus
) == naive
::memrchr(n1
, &corpus
)
122 fn qc_memrchr2_matches_naive(n1
: u8, n2
: u8, corpus
: Vec
<u8>) -> bool
{
123 memrchr2(n1
, n2
, &corpus
) == naive
::memrchr2(n1
, n2
, &corpus
)
128 fn qc_memrchr3_matches_naive(
129 n1
: u8, n2
: u8, n3
: u8,
132 memrchr3(n1
, n2
, n3
, &corpus
) == naive
::memrchr3(n1
, n2
, n3
, &corpus
)