MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / TestTableJSON

Function TestTableJSON

pkg/tabular/tabular_test.go:107–118  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

105}
106
107func TestTableJSON(t *testing.T) {
108 table, err := tabular.Parse([]byte("Path,Verified\nc:\\a.dll,Signed\n"))
109 require.NoError(t, err)
110
111 out, err := table.JSON()
112 require.NoError(t, err)
113
114 var rows []map[string]string
115 require.NoError(t, json.Unmarshal(out, &rows))
116 require.Len(t, rows, 1)
117 assert.Equal(t, "Signed", rows[0][colVerified])
118}
119
120func TestTableJSONEmptyIsArray(t *testing.T) {
121 table, err := tabular.Parse([]byte("Path,Verified\n"))

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.92
JSONMethod · 0.45

Tested by

no test coverage detected