Skip to main content

Crate perl_test_generators

Crate perl_test_generators 

Source
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.