mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
test: add test for treesitter dart implementation
This commit is contained in:
parent
43219ecb7f
commit
4e5c0bc3f8
2 changed files with 76 additions and 0 deletions
59
tests/treesitter/dart_spec.lua
Normal file
59
tests/treesitter/dart_spec.lua
Normal file
|
@ -0,0 +1,59 @@
|
|||
local util = require("tests.test_util")
|
||||
|
||||
describe("treesitter dart", function()
|
||||
it("parses all symbols correctly", function()
|
||||
util.test_file_symbols("treesitter", "./tests/treesitter/dart_test.dart", {
|
||||
{
|
||||
kind = "Class",
|
||||
name = "Class_1",
|
||||
level = 0,
|
||||
lnum = 1,
|
||||
col = 0,
|
||||
children = {
|
||||
{
|
||||
kind = "Constructor",
|
||||
name = "Class_1",
|
||||
level = 1,
|
||||
lnum = 2,
|
||||
col = 2,
|
||||
},
|
||||
{
|
||||
kind = "Function",
|
||||
name = "meth_1",
|
||||
level = 1,
|
||||
lnum = 4,
|
||||
col = 2,
|
||||
},
|
||||
{
|
||||
kind = "Function",
|
||||
name = "prop",
|
||||
level = 1,
|
||||
lnum = 6,
|
||||
col = 2,
|
||||
},
|
||||
{
|
||||
kind = "Function",
|
||||
name = "prop",
|
||||
level = 1,
|
||||
lnum = 10,
|
||||
col = 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
kind = "Function",
|
||||
name = "function_1",
|
||||
level = 0,
|
||||
lnum = 13,
|
||||
col = 0,
|
||||
},
|
||||
{
|
||||
kind = "Enum",
|
||||
name = "Enum_1",
|
||||
level = 0,
|
||||
lnum = 15,
|
||||
col = 0,
|
||||
},
|
||||
})
|
||||
end)
|
||||
end)
|
17
tests/treesitter/dart_test.dart
Normal file
17
tests/treesitter/dart_test.dart
Normal file
|
@ -0,0 +1,17 @@
|
|||
class Class_1 {
|
||||
Class_1();
|
||||
|
||||
void meth_1() { }
|
||||
|
||||
int get prop {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void set prop(int newval) { }
|
||||
}
|
||||
|
||||
void function_1() { }
|
||||
|
||||
enum Enum_1 {
|
||||
none,
|
||||
}
|
Loading…
Reference in a new issue