Skip to content

Commit

Permalink
Fix panic in tests
Browse files Browse the repository at this point in the history
actualLines may be longer than expectedLines -> index out of range
  • Loading branch information
grongor committed Mar 31, 2022
1 parent 9489caf commit b4d8eef
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/generator_test.go
Expand Up @@ -80,10 +80,11 @@ func (s *GeneratorSuite) checkGenerationWithConfig(
expectedLines := strings.Split(expected, "\n")
actualLines := strings.Split(string(actual), "\n")

// Error out at first unmatched line
for i := range actualLines {
s.Equal(expectedLines[i], actualLines[i])
}
s.Equal(
expectedLines, actualLines,
"The generator produced unexpected output.",
)

return generator
}

Expand Down

0 comments on commit b4d8eef

Please sign in to comment.