Expand description
Property-based test generators for Perl domain objects.
This crate provides reusable [proptest::Strategy] implementations for
generating Perl variables, module paths, code snippets, and Unicode
strings suitable for fuzzing parsers and LSP components.
§Example
use proptest::prelude::*;
use perl_test_generators::{variable, module_path, non_empty_unicode_string};
proptest! {
#[test]
fn vars_parse(sym in variable()) {
assert!(sym.starts_with('$') || sym.starts_with('@') || sym.starts_with('%'));
}
#[test]
fn non_empty_text(text in non_empty_unicode_string()) {
assert!(!text.is_empty());
}
}Functions§
- module_
path - Generate a full module path (1–5 segments joined by
::). - module_
path_ segments - Generate module path segments as a
Vec<String>. - non_
empty_ unicode_ string - Generate a non-empty Unicode string.
- unicode_
string - Generate a Unicode string suitable for testing UTF-8/UTF-16 conversion.
- variable
- Generate a full Perl variable name including sigil.