Skip to content

Commit

Permalink
[tests] Add server test for #7851
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Jan 27, 2025
1 parent c80a17c commit 323ba11
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/server/src/cases/issues/Issue7851.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cases.issues;

import utest.Assert;

class Issue7851 extends TestCase {
function test(_) {
vfs.putContent("a.js", getTemplate("issues/Issue7851/a.js"));
vfs.putContent("Main.hx", getTemplate("issues/Issue7851/Main.hx"));
var args = ["-main", "Main", "--js", "test.js"];

runHaxe(args);
assertSuccess();
var initialContents = vfs.getContent("test.js");
Assert.isTrue(initialContents.contains("this is a.js"));

runHaxe(args);
assertSuccess();
var contents = vfs.getContent("test.js");
Assert.equals(initialContents, contents);
}
}
4 changes: 4 additions & 0 deletions tests/server/test/templates/issues/Issue7851/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Main {
static function __init__() haxe.macro.Compiler.includeFile("a.js");
static function main() {}
}
1 change: 1 addition & 0 deletions tests/server/test/templates/issues/Issue7851/a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// this is a.js

0 comments on commit 323ba11

Please sign in to comment.