Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

The Resyntax CLI had no test coverage for argument parsing or file refactoring functionality.

Changes

  • Added 21 test cases in cli.rkt covering:

    • Argument parsing for analyze and fix commands (all flags and options)
    • End-to-end refactoring with temporary files
    • Output format validation (plain text, JSON, commit messages)
  • Test design:

    • Self-contained with temporary directories (no repository pollution)
    • Validates both option parsing and actual behavior
    • Robust assertions on file modifications, not just output text
  • Bug fix: Corrected typo in help text ("anaylze" → "analyze")

Coverage gaps (intentional)

Uncovered lines are rarely-used options (--package, --local-git-repository, --refactoring-suite, --refactoring-rule) that would require non-trivial test infrastructure.

(test-case "resyntax-fix-run: respects --max-fixes limit"
  (define test-file (make-test-racket-file test-dir "test.rkt" 
                      "#lang racket/base\n\n(or 1 (or 2 3))\n(and 4 (and 5 6))\n"))
  (call-with-args resyntax-fix-run
                  (list "--file" (path->string test-file) "--max-fixes" "1"))
  
  ;; Verify exactly one of two issues was fixed
  (define fixed-content (file->string test-file))
  (check-true (xor (string-contains? fixed-content "(or 1 2 3)")
                   (string-contains? fixed-content "(and 4 5 6)"))))
Original prompt

This section details on the original issue you should resolve

<issue_title>Resyntax CLI has poor test coverage</issue_title>
<issue_description>A few tests that check that it parses arguments correctly and refactors some temp files would go a long way.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add tests for argument parsing and refactor files Add CLI test coverage (0% → 72.83%) Dec 22, 2025
Copilot AI requested a review from jackfirth December 22, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resyntax CLI has poor test coverage

2 participants