Skip to content

Commit

Permalink
Test incremental insertion of a new model
Browse files Browse the repository at this point in the history
  • Loading branch information
PaddiM8 committed May 29, 2024
1 parent bfe7c14 commit 1dbabcf
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions server/src/project/test/document.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@ describe('ModelicaDocument', () => {
);

assert.equal(document.getText().trim(), UPDATED_TEST_PACKAGE_CONTENT.trim());

document.update(
'\n model A\n end A;',
{
start: {
line: 1,
character: 30,
},
end: {
line: 1,
character: 30,
},
}
);

const model = document.tree.rootNode.descendantsOfType("class_definition")[1];
assert.equal(model.type, "class_definition");
assert.equal(model.descendantsOfType("IDENT")[0].text, "A");
assert.equal(document.tree.rootNode.descendantsOfType("annotation_clause").length, 1);
});

it('a file with no `within` clause has the correct package path', () => {
Expand Down

0 comments on commit 1dbabcf

Please sign in to comment.