Skip to content

When printing GOLDEN/OUTPUT print the first mismatch in red.#61

Open
xross wants to merge 1 commit into
xmos:developfrom
xross:feat/color_mismatch
Open

When printing GOLDEN/OUTPUT print the first mismatch in red.#61
xross wants to merge 1 commit into
xmos:developfrom
xross:feat/color_mismatch

Conversation

@xross

@xross xross commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the debug output of ComparisonTester.run() so that when verbose printing is enabled, the first detected mismatch between the golden (expected) output and the actual output is visually emphasized in red to make failures faster to spot.

Changes:

  • Tracks the first mismatch across the comparison run and highlights it in red.
  • Consolidates mismatch detection into a line_mismatch flag to drive both failure recording and printing.
  • Adjusts ordered/unordered comparison flow to avoid attempting content comparisons once a length-based mismatch is already known for that line.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@humphrey-xmos humphrey-xmos left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be clearer output


highlight_line = line_mismatch and not highlighted_first_mismatch
if highlight_line:
highlighted_first_mismatch = True

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly confusing that "first-mismatch" is set to True, when it disables the highlighting?
Maybe swap True/False?

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.

3 participants