MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / TestAppendToFileFallback_ExistingFile

Function TestAppendToFileFallback_ExistingFile

cli/cmd/summary_test.go:23–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func 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
35func TestAppendToFileFallback_NewFile(t *testing.T) {
36 f := filepath.Join(t.TempDir(), "summary.json")

Callers

nothing calls this directly

Calls 1

appendToFileFallbackFunction · 0.85

Tested by

no test coverage detected