Skip to content

Commit

Permalink
[tests] fix and add
Browse files Browse the repository at this point in the history
closes #10287
closes #11368
  • Loading branch information
Simn committed Nov 13, 2023
1 parent 5432abb commit c6a8b20
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 5 deletions.
2 changes: 2 additions & 0 deletions tests/misc/projects/Issue10287/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
function foo() return 1;
function main() trace('${foo()blah}');
1 change: 1 addition & 0 deletions tests/misc/projects/Issue10287/compile-fail.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--main Main
2 changes: 2 additions & 0 deletions tests/misc/projects/Issue10287/compile-fail.hxml.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Main.hx:2: characters 31-35 : Unexpected blah
Main.hx:2: characters 31-35 : ... For function argument 'v'
8 changes: 8 additions & 0 deletions tests/misc/projects/Issue11368/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
macro function test() {
haxe.macro.Context.parseInlineSring("p:true,v:0", haxe.macro.Context.currentPos())
return macro null;
}

function main() {
test();
}
1 change: 1 addition & 0 deletions tests/misc/projects/Issue11368/compile-fail.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--main Main
1 change: 1 addition & 0 deletions tests/misc/projects/Issue11368/compile-fail.hxml.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Main.hx:3: characters 2-8 : Missing ;
16 changes: 11 additions & 5 deletions tests/server/src/TestCase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,25 @@ class TestCase implements ITest {
public function new() {}

function debugMessages(?pos:PosInfos) {
for (m in messages) haxe.Log.trace(m, pos);
for (m in messages)
haxe.Log.trace(m, pos);
}

function debugErrorMessages(?pos:PosInfos) {
for (m in errorMessages) haxe.Log.trace(m, pos);
for (m in errorMessages)
haxe.Log.trace(m, pos);
}

function messagesWith(s:String, ?pos:PosInfos) {
for (m in messages) if (m.contains(s)) haxe.Log.trace(m, pos);
for (m in messages)
if (m.contains(s))
haxe.Log.trace(m, pos);
}

function errorMessagesWith(s:String, ?pos:PosInfos) {
for (m in errorMessages) if (m.contains(s)) haxe.Log.trace(m, pos);
for (m in errorMessages)
if (m.contains(s))
haxe.Log.trace(m, pos);
}

static public function printSkipReason(ddr:SkipReason) {
Expand Down Expand Up @@ -211,7 +217,7 @@ class TestCase implements ITest {
}

function assertSkipping(module:String, reason:SkipReason, ?p:haxe.PosInfos) {
var msg = 'skipping $module (${printSkipReason(reason))})';
var msg = 'skipping $module (${printSkipReason(reason)})';
return Assert.isTrue(hasMessage(msg), null, p);
}

Expand Down

0 comments on commit c6a8b20

Please sign in to comment.