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//! # Example
8//!
9//! ```rust
10//! use proptest::prelude::*;
11//! use perl_test_generators::{variable, module_path, non_empty_unicode_string};
12//!
13//! proptest! {
14//!     #[test]
15//!     fn vars_parse(sym in variable()) {
16//!         assert!(sym.starts_with('$') || sym.starts_with('@') || sym.starts_with('%'));
17//!     }
18//!
19//!     #[test]
20//!     fn non_empty_text(text in non_empty_unicode_string()) {
21//!         assert!(!text.is_empty());
22//!     }
23//! }
24//! ```
25
26mod module;
27mod unicode;
28mod variable;
29
30pub use module::{module_path, module_path_segments};
31pub use unicode::{non_empty_unicode_string, unicode_string};
32pub use variable::variable;