relateby-pattern 0.4.2

Core pattern data structures
Documentation
//! Equivalence tests for pattern validation and structure analysis
//!
//! These tests verify that validation and analysis functions in pattern-rs
//! work correctly with patterns generated by the gramref CLI tool.
//!
//! **Note**: Validation and analysis functions are NEW functionality in pattern-rs.
//! They do not exist in ../pattern-hs yet, so direct equivalence testing is not possible.
//! However, we can use the `gramref generate` command to create test patterns and then
//! validate/analyze them in pattern-rs to ensure our functions work correctly.
//!
//! **Important Distinction**:
//! - `../pattern-hs/libs/` = Haskell library reference implementation (source code to port)
//! - `gramref` = CLI tool for generating test patterns (testing utility)

use pattern_core::{Pattern, StructureAnalysis, ValidationError, ValidationRules};

// Framework for testing validation and analysis with gramref-generated patterns
// Usage: gramref generate --type suite --count N --format json --value-only

#[test]
fn test_validation_equivalence_framework() {
    // Framework test - validates that validation works with basic patterns
    // Future: Can use gramref generate to create test patterns

    let pattern = Pattern::point("test".to_string());
    let rules = ValidationRules::default();

    // Should validate successfully
    assert!(pattern.validate(&rules).is_ok());
}

#[test]
fn test_analysis_equivalence_framework() {
    // Framework test - validates that analysis works with basic patterns
    // Future: Can use gramref generate to create test patterns

    let pattern = Pattern::point("test".to_string());
    let analysis = pattern.analyze_structure();

    // Should produce analysis results
    assert_eq!(analysis.depth_distribution.len(), 1);
    assert!(!analysis.summary.is_empty());
}

// TODO: Use gramref CLI to generate test patterns:
//   gramref generate --type suite --count 100 --seed 42 --format json --value-only
// Then parse patterns and test validation/analysis functions
// Reference: docs/gramref-cli-testing-guide.md