Skip to content

Commit

Permalink
[tests] add test for #8737
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Feb 4, 2025
1 parent 3c7f97e commit ed0f820
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions tests/display/src/cases/Issue8737.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package cases;

class Issue8737 extends DisplayTestCase {
/**
class Main {
static function main() {
#if macro
te{-1-}st;
#else
te{-2-}st;
#end
}
/** Test doc **\/
macro static function {-4-}test{-5-}() {
te{-3-}st;
return macro null;
}
}
**/
function test() {
function check(i:Int) {
eq("() -> haxe.macro.Expr", type(pos(i)));
eq("Test doc", doc(pos(i)));
eq(range(4, 5), position(pos(i)));
}

for (i in 1...4) check(i);
}

/**
class Main {
static function main() {
te{-1-}st();
}
/** Test doc **\/
macro static function {-2-}test{-3-}() {
return macro null;
}
}
**/
function testSimple() {
eq("() -> haxe.macro.Expr", type(pos(1)));
eq("Test doc", doc(pos(1)));
eq(range(2, 3), position(pos(1)));
}
}

0 comments on commit ed0f820

Please sign in to comment.