Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatter test setup and ignore condition #132

Merged
merged 2 commits into from
Jan 20, 2024

Commits on Jan 20, 2024

  1. Fix typo in .ignore file and rectify ignore rule logic in tests

    This commit addresses the issue where the test logic wrongfully inverted the ignore rule condition:
    
    1. A file naming typo (`003.ignroe` corrected to `003.ignore`) has been fixed, ensuring `.ignore` files are now properly recognized. Previously, the misnamed file caused certain test cases to be compared against expected outputs when they should have been ignored.
    
    2. The test logic within `formatter_test.go` that determined whether to ignore discrepancies based on `.ignore` file presence was inverted. Before the fix, the presence of an `.ignore` file led to a test error upon output mismatch, while its absence merely logged the difference without failing the test. The corrected logic now reflects the intended behavior: when an `.ignore` file is present, the differing outputs are logged for review rather than causing the test to fail.
    phelrine committed Jan 20, 2024
    Configuration menu
    Copy the full SHA
    462d74a View commit details
    Browse the repository at this point in the history
  2. Ensure fresh environment for each test case in formatter tests

    This commit updates `formatter_test.go` to address an issue where each test case was not receiving a fresh `formatEnvironment`. Previously, a single `formatEnvironment` instance was reused across multiple test cases, leading to potential dependencies on prior tests' states, such as indentation levels, that could result in unintended test failures.
    phelrine committed Jan 20, 2024
    Configuration menu
    Copy the full SHA
    bf00c55 View commit details
    Browse the repository at this point in the history