tree-sitter
tree-sitter copied to clipboard
Is there a way to skip a corpus test?
Hi, I'm writing a grammar, and I've needed this a couple of times. Is there a way to skip just one test? I know there is the --filter option, but not really what I need.
Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.81. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
@stsewd Do you have suggestions how such skipping should work? My thoughts were to add a stable sequential numbering through all tests in the output and provide ability to select/deselect tests by numbers. What do you think about?
Requires: #373
I was thinking something more like a marker/metadata on each test.
==================
Test (skip)
==================
test with failures
----
(some_nodes (that-are-not-working-yet)
If the test passes, it would be marked as an error in the test command.
A "jank" way I found to do this is to prepend two space characters to the test you want to skip.
==================
Plain struct
==================
struct Point {
x: i64
y: i64
}
---
(source_file)
The cli seems to skip this entire block. Not sure why this works, but it does.
Edit: This does not work if there are other tests in the file. The corpus parser gets all screwy. Another workaround I found is to prepend ";" to the test to be skipped if it comes after an un-skipped test.
I was thinking something more like a marker/metadata on each test.
================== Test (skip) ================== test with failures ---- (some_nodes (that-are-not-working-yet)If the test passes, it would be marked as an error in the
testcommand.
Ideally, would the marker be fed into the cli arg? As in, something like --skip-marker="(skip)"? I don't think picking a universal skip marker would be good, as someone might just use that in their test name
I thought about different markers on my own needs like error nodes is expected in a tree (and prohibited by default). I'd suggest the following syntax like:
==================
Test
:skip
:error
==================
So flags would be possible after a title and start with colon without any indents. It would be easy to search for such flags with a regular text search. Also such format allows to add parameters for specific flags in the future.
Implemented in #3060.