Parse the skip keyword argument of @testitem - #35
Merged
Conversation
`find_test_detail!` gains a `skip` branch alongside `tags`, `default_imports` and `setup`, so `skip` no longer trips the unknown-keyword error. A literal `true`/`false` is resolved here and returned as a `Bool`; anything else is returned as the source range of the expression, the same way the body is returned as `code_range`, so callers can slice the text and hand it to the test process for evaluation just before the item runs. Defaults to `false`. The value is returned as `option_skip` on the named tuple pushed to `testitems`. Adds test items for the literal, expression, default, duplicate-keyword and combined-keyword cases. They live in `test/test_skip.jl` because they exercise the parser directly; the round-trip tests through the workspace layer stay in JuliaWorkspaces.jl. Part of stream S1 (Discovery) of the ReTestItems feature-delta plan (A.10 item 5). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
Part of stream S1 (Discovery) of the ReTestItems feature-delta plan — A.10 item 5, "
skipas an item kwarg".Depends on julia-testitems/TestItems.jl#40 (docstring only, no code dependency).
What
find_test_detail!gains askipbranch alongside the existingtags/default_imports/setupbranches, following the same shape:"The keyword argument skip cannot be specified more than once."true/falseis resolved here and returned as aBoolcode_range— so the consumer can slice the text and evaluate it in the test process just before the item would runfalseskipno longer hits the unknown-keyword errorReturned as
option_skipin the named tuple pushed totestitems.Note: parentheses are trivia to JuliaSyntax, so
skip=(VERSION < v"1.11")yields the range ofVERSION < v"1.11"without the wrapping parens. Consumers that splice the text into generated code should parenthesize it themselves.Testing
New
test/test_skip.jlcovers: default, literaltrue, literalfalse, expression form (two shapes), duplicateskip,skipcombined with the other keywords, and that unknown keywords are still rejected. Run via the MCPjulia_run_testitemstools: 8/8 passing.Downstream
option_skipis a new field on the tuple, so JuliaWorkspaces.jl must land its companion PR in lockstep (it addsoption_skip::Union{Bool,String}toTestItemDetail).🤖 Generated with Claude Code