Skip to content

Visual indicator for string AreEqual doesn't work well for mismatches at the end of long strings #6784

@johnthcall

Description

@johnthcall

Summary

Good dehavior with enough characters at the end

Assert.AreEqual("01234567890123456789012345678901234567890123X", "01234567890123456789012345678901234567890123456789");

Assert.AreEqual failed. Expected string length 45 but was 50. 'expected' expression: '"01234567890123456789012345678901234567890123X"', 'actual' expression: '"01234567890123456789012345678901234567890123456789"'.
Expected: "...23456789012345678901234567890123X"
But was:  "...23456789012345678901234567890123456789"
----------------------------------------------^

Bad behavior with not enough characters at the end

Assert.AreEqual("01234567890123456789012345678901234567890123X", "01234567890123456789012345678901234567890123456");

 Assert.AreEqual failed. Expected string length 45 but was 47. 'expected' expression: '"01234567890123456789012345678901234567890123X"', 'actual' expression: '"01234567890123456789012345678901234567890123456"'.
 Expected: "...7890123456789012345678901234567890123X"
 But was:  "...78901234567890123456789012345678901..."
 ---------------------------------------------------^

Background and Motivation

While verifying new behavior for mismatches I noticed that I wasn't able to see the mismatch at the end of a long string.

Proposed Feature

Similar to how when there are 5 characters after the mismatch and the end of the longer string is shown it should not produce ellipsis to hide the mismatch for only 2 additional characters.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions