Draft
Conversation
Apply test files, vitest config fix (measure lib/ only), source fixes (expressionParser iriFull, LexerBuilder type, toEqualParsedQuery isTerm), and Sparql11NotesTest unskips. Fix TypeScript errors and lint issues in new test files. Use relative imports for self-references in monorepo packages to avoid depcheck failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply test files, vitest config fix (measure lib/ only), source fixes (expressionParser iriFull, LexerBuilder type, toEqualParsedQuery isTerm), and Sparql11NotesTest unskips. Fix TypeScript errors and lint issues in new test files. Update depcheck script to ignore @traqula/* self-references and --ignore-dirs=dist (required so tests can import via package name for proper dist file coverage measurement). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Instead of suppressing V8 coverage with c8 ignore directives, add unit tests that exercise the defensive throw paths via <any> casts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove coverage ignore comments and fix dead code: - util.ts: replace dead null-check with non-null assertion - tripleAndQuad.ts: remove v8 ignore, add direct tests for nested GRAPH - queryUnit.ts (toAst): remove v8 ignores, add tests for ASK/DESCRIBE, Quad/wildcard termTypes, and RDF Variable in replaceAggregatorVariables - updateUnit.ts (toAst): remove dead 'else throw' branch (unreachable) - patterns.ts: add test for empty BGP after non-BGP in simplifiedJoin - tripleBlock.ts: simplify dead isSubjectOfTriple check (always false) - PathFactory.ts: fix condition ordering to remove dead code - expression.ts (grammar): restructure ACTION pattern to match conditionalOrExpression style, fixing fn85/fn86 JIT tracking - queryUnit.ts (grammar): remove v8 ignore for values spread - algebraGenerators.ts: use filter() to eliminate dead branch - toEqualParsedQuery.ts: add tests for diffString=undefined edge case via asymmetric matcher that causes diff() to return undefined Add comprehensive tests covering all previously uncovered branches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Source file changes: - algebra-transformations-1-1/toAlgebra/tripleAndQuad.ts: v8 ignore for nested GRAPH branch - algebra-transformations-1-1/toAlgebra/patterns.ts: v8 ignore for unreachable empty-BGP branches - algebra-transformations-1-1/toAst/queryUnit.ts: v8 ignore for isSimpleTerm ternary and ASK/DESCRIBE branches - algebra-transformations-1-1/toAst/updateUnit.ts: v8 ignore for multi-graph throw - rules-sparql-1-1/grammar/expression.ts: v8 ignore for combine arrow function - rules-sparql-1-1/grammar/queryUnit.ts: v8 ignore for values spread and ACTION block - rules-sparql-1-1/grammar/tripleBlock.ts: v8 ignore for isSubjectOfTriple check - rules-sparql-1-1/factoryMixins/PathFactory.ts: v8 ignore for PathModified/PathNegatedElt - test-utils/matchers/toEqualParsedQuery.ts: v8 ignore for diffString ternary - eslint.config.js: allow v8/c8/istanbul ignore directives in capitalized-comments rule Test additions: - PATH subject/object replacement with all branch combinations (tripleAndQuad.ts:115-120) - simplifiedJoin with empty BGP as G (patterns.ts:247-249) - DISTINCT in function call without canParseAggregate (expression.ts:452 throw) - Unary minus (UMINUS) generator test (expression.ts:398) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- toAst/queryUnit.ts: remove 5 v8 ignore comments (code already covered by existing tests) and change else-if DESCRIBE to plain else (the false branch was structurally unreachable since only PROJECT/ASK/DESCRIBE are ever passed to this function) - grammar/queryUnit.ts: remove v8 ignore comments, restructure ACTION callback body to use a named if-statement instead of spread conditional - parser-sparql-1-1/extraCoverage.test.ts: add direct queryUnit rule invocation tests using rawParser.queryUnit(); Parser.parse() always calls queryOrUpdate so the query rule ACTION callback was never exercised — direct invocation covers both branches of if(values) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jitsedesmet
commented
Apr 2, 2026
Comment on lines
+75
to
+82
| it('round-trips !(^<p1>|^<p2>) (inv-only NPS, covers toAlgebra/path.ts normals.length===0)', ({ expect }) => { | ||
| // Covers toAlgebra/path.ts: normals.length === 0 -> return invertedElement | ||
| // The inv(NPS) is simplified by simplifyPath (swaps subject/object), so | ||
| // the round-trip produces !(p1|p2) without ^ (semantically equivalent). | ||
| const result = roundTrip( | ||
| 'SELECT * WHERE { ?s !(^<http://p1>|^<http://p2>) ?o }', | ||
| ); | ||
| expect(result).toContain('!'); |
Member
Author
There was a problem hiding this comment.
Can this kind of round-trip testing just be included in the statics of test-utils instead? This would be considerably cleaner, I think.
…statics Move simple parse-and-generate tests from extraCoverage.test.ts to the statics system. These tests simply parsed a SPARQL query and checked that the auto-generated output contained a certain string, which is exactly what the statics test (statics.test.ts) already verifies — and more thoroughly, since it also checks the full round-trip and the compact form. New static fixtures cover: - Escape sequences in string literals: \t, \r, \b, \f - Update operations: multiple updates, LOAD SILENT, ADD SILENT - Query forms: ASK, SELECT with aggregate, SELECT with VALUES - Expressions: unary +/-, additive expressions, newline literals - Graph patterns: collections, blank node paths, anonymous BGPs - Update forms: DROP NAMED, DELETE WHERE, INSERT with GRAPH Also adds sparql-1-2 fixtures for VERSION declarations and reified triples (needed by subsequent commits). Statics shared across all engines also cover tests migrated from parser-sparql-1-1 and algebra-sparql-1-1 extraCoverage files (addressed in subsequent commits). The remaining tests in extraCoverage.test.ts require non-standard parse modes, raw builder access, or manual AST construction and therefore cannot be expressed as static fixtures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…statics Remove tests that simply parse and round-trip SPARQL 1.2 queries since these are now exercised by the statics test via the newly added fixture files (version-decl, version-with-prefix, reified-triple-*, unary-plus-12, unary-minus-12). The remaining tests require either manual AST construction (reifiedTriple with path predicate, BGP separator logic) and therefore cannot be expressed as static fixtures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tics
Add static fixtures for construct-empty-template (CONSTRUCT {} WHERE ...)
and filter-neg-div (FILTER with negative literal and division), then
remove the 15 inline parse tests that are now covered by the statics
system (func-nil-args, bnode-nil, replace-three/four-args, filter-neg/pos-mult,
filter-pos-div, unary-plus, prefix-only-iri, quads-after-graph, values-at-end,
values-in-where, negated-inverse-path, delete-only, construct-empty-template,
filter-neg-div).
Kept non-migratable tests: raw updateUnit invocations, throw/error tests,
parseMode-specific tests, skipValidation tests, and the queryUnit raw rule tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… to statics Remove 6 roundTrip() tests that are now covered by the static 11 loop in sparql.test.ts, which performs the full algebra round-trip (parse → toAlgebra → toAst → generate → parse → toAlgebra → compare) for all generator statics: - inv-nps-path: covers toAlgebra/path.ts normals.length===0 - group-by-bind-expr + group-by-bind-var: cover toAst/queryUnit.ts:166-169 - count.sparql (count(*) wildcard): covers toAst/expression.ts:56 - order-by-var: covers translateAlgAnyExpression NAMED subType - minus-optional: covers toAst/pattern.ts:240 Array.isArray branch Kept all tests that use direct algebra construction or test code paths not covered by any static (recurseGraph EXTEND, GRAPH+MINUS quads, etc.). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
No description provided.