Skip to content

test: support tests with different extensions than the lang name#565

Merged
lewis6991 merged 3 commits intonvim-treesitter:masterfrom
PeterCardenas:support-tests-with-different-names
Mar 16, 2025
Merged

test: support tests with different extensions than the lang name#565
lewis6991 merged 3 commits intonvim-treesitter:masterfrom
PeterCardenas:support-tests-with-different-names

Conversation

@PeterCardenas
Copy link
Copy Markdown
Contributor

@PeterCardenas PeterCardenas commented Mar 15, 2025

previously, we only ran tests for when the treesitter language name is
the same as the extension name, but this is not the case for many
languages. in this commit, we add support for these excluded tests. For
example, test.sol was excluded because the test searches for
test.solidity which does not exist. Now, we get all files in test/lang/*
and group them by filetype, get the filetype for each treesitter
language, and run the tests that match the filetype.

The largest motivator for this is adding starlark support, which has
files with the extension .bzl.

previously, we only ran tests for when the treesitter language name is
the same as the extension name, but this is not the case for many
languages. in this commit, we add support for these excluded tests. For
example, test.sol was excluded because the test searches for
test.solidity which does not exist. Now, we get all files in test/lang/*
and group them by filetype, get the filetype for each treesitter
language, and run the tests that match the filetype.
@PeterCardenas PeterCardenas force-pushed the support-tests-with-different-names branch from d58f5b1 to e2daf50 Compare March 15, 2025 22:48
@lewis6991 lewis6991 merged commit 572e534 into nvim-treesitter:master Mar 16, 2025
5 checks passed
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.

2 participants