slint
slint copied to clipboard
Tests for slint-lsp
There are currently no tests for slint-lsp.
We should have test for auto-completion, or goto definition, and such.
One way to do it would simply to add #[test]
in the code with stuff like
#[test]
fn element_name() {
test_autocompletion(
"Foo := Ima€ { }"
&["Image"]
);
}
(the test_autocompletion funciton removes the €
character, but will consider that it is where the cursor is, and will make sure that the autocompletion return the right result)
Another way would be to have a collection of .slint files that contains the cursor position encoded as a comment or so, and have a driver that read these files.
#1570 added the first few tests.