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

Function TestColumn

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

Source from the content-addressed store, hash-verified

135}
136
137func TestColumn(t *testing.T) {
138 table, err := tabular.Parse([]byte("Path,Verified\nc:\\a.dll,Signed\n,Unsigned\nc:\\b.dll,Signed\n"))
139 require.NoError(t, err)
140
141 // Case-insensitive match, empty cells dropped.
142 values, ok := table.Column("path")
143 require.True(t, ok)
144 assert.Equal(t, []string{"c:\\a.dll", "c:\\b.dll"}, values)
145
146 // Missing column reports not found.
147 _, ok = table.Column("Nonexistent")
148 assert.False(t, ok)
149}
150
151// utf16LE encodes s as UTF-16 little-endian with a BOM, mimicking PowerShell redirection.
152func utf16LE(s string) []byte {

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.92
ColumnMethod · 0.80

Tested by

no test coverage detected