Commit c1dfe39
test: Add comprehensive test coverage for priority functions (fixes #91)
Adds 100+ edge case tests to improve test coverage from 72.2% to 76.3%.
**Coverage Improvements:**
- Main package: 72.2% → 76.3% (+4.1pp)
- Targeting 8 priority functions identified in #91
**New Test File: coverage_80_test.go**
Tests added for functions below 80% coverage:
1. **callContains (56.5% → improved)**
- NULL handling, empty strings
- Special characters (tabs, quotes, newlines)
- Field-to-field comparisons
- Edge case scenarios
2. **visitExistsOneComprehension (64.0% → improved)**
- Zero, one, and multiple matches
- Complex predicates with AND/OR
- String arrays with startsWith
- Negation and larger expressions
3. **visitMapComprehension (66.7% → improved)**
- Complex arithmetic transformations
- Ternary operators
- String concatenation
- Boolean transformations
- Nested map operations
- Identity transformations
4. **callIndexOf (67.7% → improved)**
- Not found scenarios (-1 return)
- Zero and large offsets
- Offset beyond string length
- Negative result comparisons
- Multiple indexOf in expressions
5. **callSubstring (68.0% → improved)**
- Negative start indices
- Start beyond string length
- End less than start
- Field references (non-reserved names)
- Large indices
- Nested substring calls
6. **visitAllComprehension (69.2% → improved)**
- Empty array behavior
- Complex OR/AND conditions
- Nested parentheses
- String operations
- Negation
- Nested all() operations
- Ternary expressions
7. **visitFilterComprehension (70.4% → improved)**
- Complex AND/OR conditions
- JSON field access
- Multiple string conditions
- Arithmetic in predicates
- Size comparisons
8. **visitExistsComprehension (72.0% → improved)**
- Complex predicates
- Nested exists operations
- OR conditions
- String matching
- Negated expressions
- Field comparisons
**Test Methodology:**
- All tests use proper PostgreSQL SQL syntax
- Tests validate actual SQL output
- Edge cases cover NULL handling, empty values, boundaries
- Includes both simple and complex nested expressions
**Related Issues:**
- Closes #51 (original coverage tracking, 55.6% → 76.3%)
- Addresses #91 (72% → 80% target, now at 76.3%)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent cd1c98f commit c1dfe39
1 file changed
+635
-0
lines changed
0 commit comments