diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2023-01-01 15:16:04 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2023-01-01 15:32:07 +0100 |
| commit | 6a31d9086e38bde36415c736ed189747971cf2af (patch) | |
| tree | f031b781dc0d01fc584650f7da973c4f23adb500 /tests/query | |
| parent | ci: allow negative assertions in tests (diff) | |
| download | nvim-treesitter-6a31d9086e38bde36415c736ed189747971cf2af.tar nvim-treesitter-6a31d9086e38bde36415c736ed189747971cf2af.tar.gz nvim-treesitter-6a31d9086e38bde36415c736ed189747971cf2af.tar.bz2 nvim-treesitter-6a31d9086e38bde36415c736ed189747971cf2af.tar.lz nvim-treesitter-6a31d9086e38bde36415c736ed189747971cf2af.tar.xz nvim-treesitter-6a31d9086e38bde36415c736ed189747971cf2af.tar.zst nvim-treesitter-6a31d9086e38bde36415c736ed189747971cf2af.zip | |
highlights(rust): use `@namespace` for `[(crate) (self) (super)]`
Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/3992
Diffstat (limited to 'tests/query')
| -rw-r--r-- | tests/query/highlights_spec.lua | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/tests/query/highlights_spec.lua b/tests/query/highlights_spec.lua index ff022ba21..8bfd3c2ec 100644 --- a/tests/query/highlights_spec.lua +++ b/tests/query/highlights_spec.lua @@ -76,21 +76,39 @@ local function check_assertions(file) end end end, true) - assert.True( - captures[assertion.expected_capture_name] or highlights[assertion.expected_capture_name], - "Error in at " - .. file - .. ":" - .. (row + 1) - .. ":" - .. (col + 1) - .. ': expected "' - .. assertion.expected_capture_name - .. '", captures: ' - .. vim.inspect(vim.tbl_keys(captures)) - .. '", highlights: ' - .. vim.inspect(vim.tbl_keys(highlights)) - ) + if assertion.expected_capture_name:match "^!" then + assert.Falsy( + captures[assertion.expected_capture_name:sub(2)] or highlights[assertion.expected_capture_name:sub(2)], + "Error in at " + .. file + .. ":" + .. (row + 1) + .. ":" + .. (col + 1) + .. ': expected "' + .. assertion.expected_capture_name + .. '", captures: ' + .. vim.inspect(vim.tbl_keys(captures)) + .. '", highlights: ' + .. vim.inspect(vim.tbl_keys(highlights)) + ) + else + assert.True( + captures[assertion.expected_capture_name] or highlights[assertion.expected_capture_name], + "Error in at " + .. file + .. ":" + .. (row + 1) + .. ":" + .. (col + 1) + .. ': expected "' + .. assertion.expected_capture_name + .. '", captures: ' + .. vim.inspect(vim.tbl_keys(captures)) + .. '", highlights: ' + .. vim.inspect(vim.tbl_keys(highlights)) + ) + end end end |
