1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-21 12:16:54 +02:00

Fix reporting of unexpected selections in integration tests

Expected and actual selection were swapped in the error message.
This commit is contained in:
Stefan Haller 2024-06-14 13:26:14 +02:00
parent c08a5fe4e7
commit 43e04febee

View File

@ -263,8 +263,8 @@ func (self *ViewDriver) assertLines(offset int, matchers ...*TextMatcher) *ViewD
return false, fmt.Sprintf( return false, fmt.Sprintf(
"Unexpected selection in view '%s'. Expected %s to be selected but got %s.\nExpected selected lines:\n---\n%s\n---\n\nActual selected lines:\n---\n%s\n---\n", "Unexpected selection in view '%s'. Expected %s to be selected but got %s.\nExpected selected lines:\n---\n%s\n---\n\nActual selected lines:\n---\n%s\n---\n",
view.Name(), view.Name(),
formatLineRange(startIdx, endIdx),
formatLineRange(expectedStartIdx, expectedEndIdx), formatLineRange(expectedStartIdx, expectedEndIdx),
formatLineRange(startIdx, endIdx),
strings.Join(expectedSelectedLines, "\n"), strings.Join(expectedSelectedLines, "\n"),
strings.Join(lines, "\n"), strings.Join(lines, "\n"),
) )