slint icon indicating copy to clipboard operation
slint copied to clipboard

Tests for slint-lsp

Open ogoffart opened this issue 1 year ago • 1 comments

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.

ogoffart avatar Aug 22 '22 06:08 ogoffart

#1570 added the first few tests.

hunger avatar Aug 31 '22 16:08 hunger