Fix lint issues and improve test coverage for Unmarshaler interface

- Apply De Morgan's law in keyNeedsQuoting to satisfy staticcheck QF1001
- Remove unused splitTableUnmarshaler type from test
- Fix unused parameter lint warning in errorUnmarshaler873
- Add test for quoted keys that need special handling
- Add test for error propagation from UnmarshalTOML
- Update customTable873 parser to handle quoted keys properly

Coverage improved:
- handleKeyValuesUnmarshaler: 80.0% -> 93.3%
- keyNeedsQuoting: 66.7% -> 83.3%
- Overall main package: 97.2% -> 97.5%
This commit is contained in:
Claude
2026-01-15 17:37:03 +00:00
parent 2762e24a9c
commit 013ffc24b8
2 changed files with 56 additions and 7 deletions
+2 -2
View File
@@ -749,8 +749,8 @@ func keyNeedsQuoting(key []byte) bool {
}
for _, b := range key {
// Bare keys can only contain A-Za-z0-9_-
if !((b >= 'A' && b <= 'Z') || (b >= 'a' && b <= 'z') ||
(b >= '0' && b <= '9') || b == '_' || b == '-') {
if (b < 'A' || b > 'Z') && (b < 'a' || b > 'z') &&
(b < '0' || b > '9') && b != '_' && b != '-' {
return true
}
}