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

Resolved formatting issues in test command output #281

Conversation

matthewnitschke-wk
Copy link
Contributor

The new test command introduced in this PR contained some issues when rendering the failure list.

Upon failure, this is what the output would look like

✗ lib/functions.dart
    Failure - row: 2, column: 2
      Expected: 'definition asdf'
      Actual:
        - 'reference scip-dart pub scip_dart_test 1.0.0 lib/`functions.dart`/withReturn().'
        - 'diagnostic Information'
          ''withReturn' is deprecated and shouldn't be used. a.'    Failure - row: 14, column: 2
      Expected: 'reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int#'
      Actual:
        - 'reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int#'✗ Missing documents in SCIP index
    test/.dart_tool/package_config.json
    test/pubspec.lock
    test/pubspec.yaml

After this change, the output now looks like this

✗ lib/functions.dart
    Failure [Ln: 3, Col: 2]
      Expected: 'definition asdf'
      Actual: * 'reference scip-dart pub scip_dart_test 1.0.0 lib/`functions.dart`/withReturn().'
              * 'diagnostic Information'
                ''withReturn' is deprecated and shouldn't be used. a.'
    Failure [Ln: 15, Col: 2]
      Expected: 'reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int#'
      Actual:   'reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int#'
✗ Missing documents in SCIP index
    test/.dart_tool/package_config.json
    test/pubspec.lock
    test/pubspec.yaml

Notable updates being:

  • The line break after the last failure in a test file has been resolved
  • The Expected vs Actual lines are on the same column, making it easier to locate inconsistencies
  • Mutli-result "Actual" statements are now prefixed with a *, to indicate they are "one of many". This also helps delineate multiline test attributes

@varungandhi-src
Copy link
Contributor

Hey, sorry we missed merging this earlier. Please feel free to tag me directly for PR reviews.

@varungandhi-src varungandhi-src merged commit 72e45aa into sourcegraph:main Oct 17, 2024
1 check passed
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.

2 participants