Browse Source

Test for #3387. Not very reliable, any ideas how to improve this?

Dan Korostelev 11 năm trước cách đây
mục cha
commit
4ce44e34e3
1 tập tin đã thay đổi với 12 bổ sung0 xóa
  1. 12 0
      tests/unit/issues/Issue3387.hx

+ 12 - 0
tests/unit/issues/Issue3387.hx

@@ -0,0 +1,12 @@
+package unit.issues;
+
+class Issue3387 extends unit.Test {
+    function test() {
+        eq("#pos(some:1: lines 1-4)", getPos("{\n1;\n2;\n3;}", "some"));
+    }
+
+    static macro function getPos(source:String, file:String) {
+        var e = haxe.macro.Context.parseInlineString(source, haxe.macro.Context.makePosition({min: 0, max: 0, file: file}));
+        return macro $v{Std.string(e.pos)};
+    }
+}