Extend generator filtering to support element ranges
Maintainers usually reply within 2 days
Nobody has claimed this yet.
- #3189 by @annacastroops — closed without merging
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- cli, testing-qa
Research direction
Start by locating the recently added generator filtering implementation and the test specifications that already use commas as OR. Define the accepted range syntax and validation behavior from the examples and design questions, then add coverage for combinations, ordering, duplicates, overlaps, and malformed or negative ranges; done means valid filters select the intended generator elements and invalid filters are rejected.
Written by the indexing model from the issue text.
Description
Note that all the ideas here are fully backwards compatible, so the
extension can be implemented without a breaking change
The recently-added generator filtering only allows filtering to a singular
element. This can be extended to support multiple elements and/or element
ranges.
For multiple separate elements, we can reuse the concept of commas as "OR"
from the test specs. This would then mean that -g 1,3,4 filters the
generator to indices 1, 3, and 4. For element ranges, we can use
the start-end format, so that -g 1-4 would filter the generator to
indices 1, 2, 3, and 4.
These two should also be combinable, so that -g 1,3,6-10 filters the
generator to indices 1, 3, 6, 7, ..., 10.
Examples
Accepted
-g 1,2- Elements at indices 1 and 2.-g 1-3- Elements at indices 1, 2, and 3.-g 1-1- Single element range, only the element at index 1.-g 1-3,4,5-10- Elements at indices 1,...,10.
Rejected
-g 1-3,2-4- The two element ranges are overlapping-g 3,2,1- Elements are in bad order, must be monotonically increasing-g 3-1- Range is decreasing, see above-g 1,2,2,3- 3rd element is duplicated-g -2- Negative number, should still be rejected-g 1--2- Syntactically invalid-g 1-2-3- Syntactically invalid
Design questions
-
Should the ranges be closed? Programming usually uses half-open ranges,
but closed-ranges feel more intuitive for specifying the range on the
command line. -
Should we error out on bad-but-fixable filters? Erroring out is less
confusing, but fixing can be more user friendly.- Duplicated indices can be deduplicated.
- Unsorted indices can be sorted
- Overlapping ranges could be merged
-
Should we support partially-specified ranges?
3-*could mean "From 4th element to the end of the generator"
- Dominant language
- C++
- Stars
- 21.6k
- Forks
- 3.4k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from catchorg/Catch2
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 2 days
-
catch_discover_tests passes all EXTRA_ARGS as one argumentPossibly taken @CyberKun claimed this 11 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
catchorg/Catch2#3239 · 1 comment ·
Maintainers usually reply within 2 days
-
Not seeing some error messages from fakeit in jetbrains riderPossibly taken @Amanpal9 claimed this 21 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
catchorg/Catch2#3228 · 1 comment ·
Maintainers usually reply within 2 days
-
catch_discover_tests fails for Emscripten/WASM tests since v3.16.0Possibly taken @nafiurahman00 claimed this 8 days ago. OpenExtras
Difficulty 3/5 1-2 days Newbie friendliness 72/100
catchorg/Catch2#3241 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 2 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cp-algorithms/cp-algorithms#1774 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
telefonicaid/fiware-orion#4836 ·
Maintainers usually reply within 1 day
-
nixd exits at startup when its parent process belongs to another userPossibly taken @conao3 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nix-community/nixd#930 ·
Maintainers usually reply within 2 days
-
refactor topic-ui topic-weather
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Command-Install Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
microsoft/winget-cli#6718 ·
Maintainers usually reply within 2 days