Skip to main content

perl_tdd_support/
lib.rs

1//! Test-driven development helpers and generators for Perl.
2//!
3//! This crate provides tools to support TDD workflows when working with Perl code,
4//! including test generation, execution runners, and validation utilities for
5//! Perl parser and LSP development.
6//!
7//! # Overview
8//!
9//! The TDD support crate offers:
10//! - Test case generators for Perl syntax patterns
11//! - Test execution runners with result capture
12//! - Basic TDD workflow helpers for parser development
13//! - Utilities for validating parser behavior against expected outcomes
14//!
15//! # Example
16//!
17//! ```no_run
18//! use perl_tdd_support::tdd_basic;
19//!
20//! // Use TDD helpers to validate parser behavior
21//! // (specific APIs depend on tdd module implementation)
22//! ```
23
24#![deny(unsafe_code)]
25#![deny(unreachable_pub)]
26#![warn(rust_2018_idioms)]
27#![warn(missing_docs)]
28// This crate provides test helpers that intentionally panic on failure.
29// The must/must_some/must_err helpers are designed to panic in tests.
30#![allow(clippy::panic)]
31#![allow(
32    clippy::too_many_lines,
33    clippy::module_name_repetitions,
34    clippy::cast_possible_truncation,
35    clippy::cast_sign_loss,
36    clippy::cast_precision_loss,
37    clippy::cast_possible_wrap,
38    clippy::must_use_candidate,
39    clippy::missing_errors_doc,
40    clippy::missing_panics_doc,
41    clippy::wildcard_imports,
42    clippy::enum_glob_use,
43    clippy::match_same_arms,
44    clippy::if_not_else,
45    clippy::struct_excessive_bools,
46    clippy::items_after_statements,
47    clippy::return_self_not_must_use,
48    clippy::unused_self,
49    clippy::collapsible_match,
50    clippy::collapsible_if,
51    clippy::only_used_in_recursion,
52    clippy::items_after_test_module,
53    clippy::while_let_loop,
54    clippy::single_range_in_vec_init,
55    clippy::arc_with_non_send_sync,
56    clippy::needless_range_loop,
57    clippy::result_large_err,
58    clippy::if_same_then_else,
59    clippy::should_implement_trait,
60    clippy::manual_flatten,
61    clippy::needless_raw_string_hashes,
62    clippy::single_char_pattern,
63    clippy::uninlined_format_args
64)]
65
66pub use perl_parser_core::{Node, NodeKind, SourceLocation};
67pub use perl_parser_core::{ParseError, ParseResult, error, parser};
68pub use perl_parser_core::{Parser, ast, position};
69
70/// Test-driven development helpers and generators.
71pub mod tdd;
72
73pub use tdd::tdd_basic;
74pub use tdd::tdd_workflow;
75pub use tdd::test_generator;
76/// Test execution and TDD support functionality.
77pub use tdd::test_runner;
78
79/// Safe unwrap replacements for tests.
80/// Re-exported from `perl-test-must` for backward compatibility.
81pub use perl_test_must::{must, must_err, must_some};
82
83/// CI Guardrail Ignored Test Monitoring and Governance.
84pub mod governance;