MCPcopy Create free account
hub / github.com/conforma/cli / TestWriteTempFile

Function TestWriteTempFile

internal/utils/helpers_test.go:36–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

34}
35
36func TestWriteTempFile(t *testing.T) {
37 fs := afero.NewMemMapFs()
38 data := "file contents"
39 ctx := WithFS(context.Background(), fs)
40 path, err := WriteTempFile(ctx, data, "ec")
41 assert.NoError(t, err)
42 contents, err := afero.ReadFile(fs, path)
43 assert.NoError(t, err)
44 assert.Equal(t, data, string(contents))
45}
46
47func TestIsJson(t *testing.T) {
48 tests := []struct {

Callers

nothing calls this directly

Calls 2

WithFSFunction · 0.85
WriteTempFileFunction · 0.85

Tested by

no test coverage detected