Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jotaen committed Mar 3, 2024
1 parent f5cf57c commit 4a55413
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions klog/app/cli/util/prettifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ func TestFormatParserError(t *testing.T) {
func TestReflowsLongMessages(t *testing.T) {
block, _ := txt.ParseBlock("Foo bar", 1)
err := app.NewParserErrors([]txt.Error{
txt.NewError(block, 0, 4, 3, "CODE", "Some Title", "A verbose description with details, potentially spanning multiple lines with a comprehensive text and tremendously helpful information.\nBut it respects newlines."),
txt.NewError(block, 0, 4, 3, "CODE", "Some Title", "A verbose description with details, potentially spanning multiple lines with a comprehensive text and tremendously helpful information.\nBut\nit\nrespects\nnewlines."),
})
text := PrettifyParsingError(err, false, styler).Error()
assert.Equal(t, `
[SYNTAX ERROR] in line 2
Foo bar
^^^
Some Title: A verbose description with details, potentially
spanning multiple lines with a comprehensive text
and tremendously helpful information.
But it respects newlines.
Some Title: A verbose description with details, potentially spanning multiple
lines with a comprehensive text and tremendously helpful information.
But
it
respects
newlines.
`, tf.StripAllAnsiSequences(text))
}

Expand Down

0 comments on commit 4a55413

Please sign in to comment.