(t *testing.T)
| 228 | } |
| 229 | |
| 230 | func TestStripUTF8BOM(t *testing.T) { |
| 231 | cases := []struct{ name, in, want string }{ |
| 232 | {"leading BOM removed", "\uFEFFhello", "hello"}, |
| 233 | {"no BOM unchanged", "hello", "hello"}, |
| 234 | {"empty unchanged", "", ""}, |
| 235 | {"only BOM becomes empty", "\uFEFF", ""}, |
| 236 | {"interior BOM preserved", "a\uFEFFb", "a\uFEFFb"}, |
| 237 | {"only the first BOM removed", "\uFEFF\uFEFFx", "\uFEFFx"}, |
| 238 | } |
| 239 | for _, c := range cases { |
| 240 | if got := stripUTF8BOM(c.in); got != c.want { |
| 241 | t.Errorf("%s: stripUTF8BOM(%q) = %q, want %q", c.name, c.in, got, c.want) |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | func TestResolveInputFlags_StripBOMStdin(t *testing.T) { |
| 247 | // A CSV piped via stdin with a leading BOM (e.g. from an upstream export) |
nothing calls this directly
no test coverage detected