test: Improve test coverage from 72% to 76% (toward 80% target)#92
Merged
richardwooding merged 1 commit intomainfrom Oct 31, 2025
Merged
test: Improve test coverage from 72% to 76% (toward 80% target)#92richardwooding merged 1 commit intomainfrom
richardwooding merged 1 commit intomainfrom
Conversation
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 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves test coverage from 72.2% to 76.3% (+4.1 percentage points) by adding comprehensive edge case tests for 8 priority functions identified in issue #91.
Progress Toward 80% Goal
Changes
New Test File:
coverage_80_test.goAdded 100+ edge case tests targeting functions with lowest coverage:
1.
callContains(56.5% → improved)2.
visitExistsOneComprehension(64.0% → improved)3.
visitMapComprehension(66.7% → improved)4.
callIndexOf(67.7% → improved)5.
callSubstring(68.0% → improved)6.
visitAllComprehension(69.2% → improved)7.
visitFilterComprehension(70.4% → improved)8.
visitExistsComprehension(72.0% → improved)Test Quality
make fmtmake lintwith 0 issuesCoverage Analysis
Main Package Coverage:
pg Package: 92.1% (unchanged, already excellent)
Related Issues
Next Steps
To reach the 80% target (remaining 3.7pp), we would need to:
This PR provides a solid foundation and substantial progress toward the goal.
Test Plan
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com