Skip to content

Commit

Permalink
[tests] be more specific for 7931 test
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Nov 30, 2023
1 parent b8b2dfc commit 3fc4bda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/server/src/cases/issues/Issue7931.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ package cases.issues;

class Issue7931 extends TestCase {
function test(_) {
vfs.putContent("Main.hx", getTemplate("issues/Issue7931/Main.hx"));
var content = getTemplate("issues/Issue7931/Main.hx");
var transform = Markers.parse(content);

vfs.putContent("Main.hx", transform.source);
var args = ["-main", "Main"];
runHaxe(args);
assertErrorMessage("Local variable s used without being initialized");
runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Main.hx")}, res -> {
Assert.equals("Local variable s used without being initialized", res[0].diagnostics[0].args);
Assert.same(transform.range(1,2), res[0].diagnostics[0].range);
});
}
}
2 changes: 1 addition & 1 deletion tests/server/test/templates/issues/Issue7931/Main.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Main {
static function main() {
var s:String;
s += "test";
{-1-}s{-2-} += "test";
}
}

0 comments on commit 3fc4bda

Please sign in to comment.