Clarify comment on CRLF normalization in tests
Updated comments in log_test.go to clarify that CRLF is normalized to LF for OS-agnostic test behavior, improving code readability.
This commit is contained in:
parent
37d8e0a438
commit
d636f4c213
1 changed files with 2 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ func TestFollow(t *testing.T) {
|
|||
raw, err := os.ReadFile(tt.log)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Delete all the `/r` to make the tests OS-agnostic.
|
||||
// Normalize CRLF to LF to make the tests OS-agnostic.
|
||||
raw = []byte(strings.ReplaceAll(string(raw), "\r\n", "\n"))
|
||||
|
||||
lines := slices.DeleteFunc(strings.Split(string(raw), "\n"), func(line string) bool {
|
||||
|
|
@ -63,7 +63,7 @@ func TestFollow(t *testing.T) {
|
|||
want, err := os.ReadFile(tt.want)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Delete all the `/r` to make the tests OS-agnostic.
|
||||
// Normalize CRLF to LF to make the tests OS-agnostic.
|
||||
want = []byte(strings.ReplaceAll(string(want), "\r\n", "\n"))
|
||||
|
||||
assert.Equal(t, string(want), stdout.String())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue