| 135 | } |
| 136 | |
| 137 | func 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. |
| 152 | func utf16LE(s string) []byte { |