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

Function TestAppendToFile_AppendsData

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

Source from the content-addressed store, hash-verified

9)
10
11func TestAppendToFile_AppendsData(t *testing.T) {
12 f := filepath.Join(t.TempDir(), "summary.json")
13 require.NoError(t, os.WriteFile(f, []byte("line1\n"), 0644))
14
15 err := appendToFile(f, []byte("line2\n"))
16 require.NoError(t, err)
17
18 got, err := os.ReadFile(f)
19 require.NoError(t, err)
20 require.Equal(t, "line1\nline2\n", string(got))
21}
22
23func TestAppendToFileFallback_ExistingFile(t *testing.T) {
24 f := filepath.Join(t.TempDir(), "summary.json")

Callers

nothing calls this directly

Calls 1

appendToFileFunction · 0.85

Tested by

no test coverage detected