1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2026 Erik Lening (hollowpointer) and Contributors
//
// This file is part of Zond Engine, licensed under the GNU Affero General
// Public License, version 3 or later. See the LICENSE file for details, or
// <https://www.gnu.org/licenses/agpl-3.0.html>.
//
// SPDX-License-Identifier: AGPL-3.0-or-later
//! # Property tests for pattern compilation
//!
//! Apart from [`pattern`](super::pattern) itself, and only because of where that
//! file has to live.
//!
//! `build.rs` loads `pattern.rs` with `#[path]`, so the build script compiles
//! the very same source the library does, which is what stops the patterns the
//! build validates from drifting away from the patterns the engine can match.
//! The build script's dependency set is its own, though, and `proptest` is a
//! dev-dependency that is not in it. Cargo strips `#[cfg(test)]` before the
//! build script is compiled so nothing breaks, but any tool reading that file
//! in the build script's context sees an import it cannot resolve, and reports
//! it.
//!
//! Keeping the property tests here rather than there costs nothing and removes
//! that: this module is declared only by the library, so the build script never
//! sees it at all.
use compile;
use *;
/// The compiled-size ceiling the runtime and the build both use.
const LIMIT: usize = 32 * 1024 * 1024;
proptest!