Skip to content

Expand test coverage for glob.rs brace validation before refactoring #242

@coderabbitai

Description

@coderabbitai

Context

The brace validation logic in src/manifest/glob.rs is complex with significant cyclomatic complexity (~47 conditional/control flow statements), but currently has only 3 test functions covering this code.

Problem

Before undertaking refactoring work proposed in #171 and #172, we need comprehensive test coverage to:

  • Ensure current behaviour is well-documented through tests
  • Provide a safety net during refactoring
  • Prevent regressions
  • Validate edge cases in brace matching, escape sequences, and state transitions

Requirements

Expand test coverage for:

  • CharContext and BraceValidationState structures
  • BraceValidator implementation including all state transitions
  • Edge cases in brace matching (nested braces, escaped braces, malformed patterns)
  • Platform-specific logic (Windows vs Unix path handling)
  • validate_brace_matching function
  • process_escape_sequence function

Acceptance Criteria

  • Test coverage includes happy paths for all major code paths
  • Edge cases and error conditions are tested
  • Platform-specific behaviour is validated
  • Tests are well-documented explaining what behaviour they validate

Blocked Issues

This issue blocks:

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions