(t *testing.T)
| 334 | } |
| 335 | |
| 336 | func TestNormalizeOutput(t *testing.T) { |
| 337 | t.Parallel() |
| 338 | tests := []struct { |
| 339 | name string |
| 340 | input []byte |
| 341 | expected []byte |
| 342 | }{ |
| 343 | {"CRLF to LF", []byte("line1\r\nline2\r\n"), []byte("line1\nline2\n")}, |
| 344 | {"CR to LF", []byte("line1\rline2\r"), []byte("line1\nline2\n")}, |
| 345 | {"Windows path", []byte(`D:\a\task\task`), []byte(`D:/a/task/task`)}, |
| 346 | {"JSON escaped backslash", []byte(`{"path":"D:\\a\\task"}`), []byte(`{"path":"D:/a/task"}`)}, |
| 347 | {"Mixed", []byte("D:\\a\\task\r\n"), []byte("D:/a/task\n")}, |
| 348 | {"Unix path unchanged", []byte("/home/user/task\n"), []byte("/home/user/task\n")}, |
| 349 | } |
| 350 | for _, tt := range tests { |
| 351 | t.Run(tt.name, func(t *testing.T) { |
| 352 | t.Parallel() |
| 353 | got := normalizeOutput(tt.input) |
| 354 | assert.Equal(t, tt.expected, got) |
| 355 | }) |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | func TestNormalizePathSeparators(t *testing.T) { |
| 360 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…