Skip to content

test: support injected query tests#584

Closed
PeterCardenas wants to merge 2 commits intonvim-treesitter:masterfrom
PeterCardenas:support-injected-query-tests
Closed

test: support injected query tests#584
PeterCardenas wants to merge 2 commits intonvim-treesitter:masterfrom
PeterCardenas:support-injected-query-tests

Conversation

@PeterCardenas
Copy link
Copy Markdown
Contributor

@PeterCardenas PeterCardenas commented Apr 12, 2025

The context_spec.lua tests do not cover test files that have injected queries. To cover these, we recursively parse the file to get the injected languages parsed, which then can be used later for the context tests. This PR also includes updating the html and markdown test files to take advantage of this capability.

Followup to #568

TODO:

  • Tests now take a really long time after this change, likely due to treesitter parsing and parsing the whole file for each language

Before we had snapshots to cover injected query tests, but now we can
use the cursor and context markers to test these as well. This will mean
that we might be installing more parsers and parsing more than we should
be, but I think the higher test coverage is worth it.
@PeterCardenas PeterCardenas marked this pull request as draft April 12, 2025 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant