(t *testing.T)
| 21 | } |
| 22 | |
| 23 | func TestAppendToFileFallback_ExistingFile(t *testing.T) { |
| 24 | f := filepath.Join(t.TempDir(), "summary.json") |
| 25 | require.NoError(t, os.WriteFile(f, []byte("line1\n"), 0644)) |
| 26 | |
| 27 | err := appendToFileFallback(f, []byte("line2\n")) |
| 28 | require.NoError(t, err) |
| 29 | |
| 30 | got, err := os.ReadFile(f) |
| 31 | require.NoError(t, err) |
| 32 | require.Equal(t, "line1\nline2\n", string(got)) |
| 33 | } |
| 34 | |
| 35 | func TestAppendToFileFallback_NewFile(t *testing.T) { |
| 36 | f := filepath.Join(t.TempDir(), "summary.json") |
nothing calls this directly
no test coverage detected