| 75 | } |
| 76 | |
| 77 | func TestSepDetect_InconsistentSeparators(t *testing.T) { |
| 78 | sd := sepDetecor{} |
| 79 | lines := []string{ |
| 80 | "Name,Age,City", |
| 81 | "Alice|30|NYC", |
| 82 | "Bob\t25\tLA", |
| 83 | } |
| 84 | |
| 85 | // Should detect the most consistent separator |
| 86 | sep := sd.sepDetect(lines) |
| 87 | // Any valid separator is acceptable here |
| 88 | // With inconsistent separators, detection may fail (return 0) |
| 89 | // or detect the first consistent one |
| 90 | t.Logf("Detected separator for inconsistent input: %c (code: %d)", sep, sep) |
| 91 | } |
| 92 | |
| 93 | func TestIsValidSeparator(t *testing.T) { |
| 94 | sd := sepDetecor{} |