Skip to main content

perl_test_generators/
lib.rs

1//! Property-based test generators for Perl domain objects.
2//!
3//! This crate provides reusable [`proptest::Strategy`] implementations for
4//! generating Perl variables, module paths, code snippets, and Unicode
5//! strings suitable for fuzzing parsers and LSP components.
6
7// The crate-level doctest demonstrates `proptest!` syntax, which uses `#[test]`.
8#![allow(clippy::test_attr_in_doctest)]
9//!
10//! # Example
11//!
12//! ```rust
13//! use proptest::prelude::*;
14//! use perl_test_generators::{variable, module_path, non_empty_unicode_string};
15//!
16//! proptest! {
17//!     #[test]
18//!     fn vars_parse(sym in variable()) {
19//!         assert!(sym.starts_with('$') || sym.starts_with('@') || sym.starts_with('%'));
20//!     }
21//!
22//!     #[test]
23//!     fn non_empty_text(text in non_empty_unicode_string()) {
24//!         assert!(!text.is_empty());
25//!     }
26//! }
27//! ```
28
29mod code;
30mod module;
31mod unicode;
32mod variable;
33
34pub use code::{
35    integer_literal, perl_identifier, scalar_variable, simple_expression, simple_program,
36    simple_statement, single_quoted_string_literal,
37};
38pub use module::{module_path, module_path_segments};
39pub use unicode::{non_empty_unicode_string, unicode_string};
40pub use variable::variable;