Skip to content

Commit

Permalink
[tests] add test for HaxeFoundation#7931
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz authored and 0b1kn00b committed Jan 25, 2024
1 parent 7ba8fd9 commit 74d8783
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/server/src/cases/issues/Issue7931.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package cases.issues;

class Issue7931 extends TestCase {
function test(_) {
vfs.putContent("Main.hx", getTemplate("issues/Issue7931/Main.hx"));
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);
});
}
}
6 changes: 6 additions & 0 deletions tests/server/test/templates/issues/Issue7931/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Main {
static function main() {
var s:String;
s += "test";
}
}

0 comments on commit 74d8783

Please sign in to comment.