Skip to content

Commit

Permalink
Clarify situation where undefined position arises
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Jul 1, 2024
1 parent b504982 commit d3c67b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gui/test/app/Stanc/Linting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const jacobianWarning = `Warning in 'jacobian.stan', line 1, column 12: Variable
be a reserved word starting in Stan 2.38.0. Please rename it!
`;

// note: stanc can produce warnings like this that do not contain a position!
const emptyModelWarning = `Warning: Empty file 'empty.stan' detected; this is a valid stan model but
likely unintended!`;

const multiColumnError = `Semantic error in 'multicol.stan', line 3, column 4 to column 10:
-------------------------------------------------
1: parameters {
Expand Down Expand Up @@ -49,9 +53,8 @@ describe("Linting", () => {
expect(position).toBeUndefined();
});

test("random message returns undefined", () => {
const message = "random message";
const position = locationFromMessage(message);
test("message without position returns undefined", () => {
const position = locationFromMessage(emptyModelWarning);
expect(position).toBeUndefined();
});

Expand Down

0 comments on commit d3c67b7

Please sign in to comment.