From ed0f820b946eec8dc8229001926904efbbc4055f Mon Sep 17 00:00:00 2001 From: Rudy Ges Date: Tue, 4 Feb 2025 11:13:06 +0100 Subject: [PATCH] [tests] add test for #8737 --- tests/display/src/cases/Issue8737.hx | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/display/src/cases/Issue8737.hx diff --git a/tests/display/src/cases/Issue8737.hx b/tests/display/src/cases/Issue8737.hx new file mode 100644 index 00000000000..396140436b8 --- /dev/null +++ b/tests/display/src/cases/Issue8737.hx @@ -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))); + } +}