Browse Source

change test #9336
gave up on fighting unix/win differences

Aleksandr Kuzmenko 5 years ago
parent
commit
0401413a6f

+ 8 - 2
tests/misc/projects/Issue9336/Main.hx

@@ -1,4 +1,5 @@
 import haxe.macro.Context;
+import haxe.macro.PositionTools;
 
 class Main {
 	#if !macro
@@ -8,9 +9,14 @@ class Main {
 	#end
 	static macro function test() {
 		var pos = Context.makePosition({min: 20, max: 23, file: 'my_template.mtt' });
-		Context.warning('check pos', pos);
+		var range = PositionTools.toLocation(pos).range;
+		if(range.start.line != range.end.line || range.end.line != 2) {
+			Context.fatalError('Invalid position', pos);
+		}
 		Context.parse('foo', pos);
-		Context.warning('check pos', pos);
+		if(range.start.line != range.end.line || range.end.line != 2) {
+			Context.fatalError('Invalid position after Context.parse', pos);
+		}
 		return macro null;
 	}
 }

+ 0 - 2
tests/misc/projects/Issue9336/compile.hxml.stderr

@@ -1,2 +0,0 @@
-my_template.mtt:2: characters 3-6 : Warning : check pos
-my_template.mtt:2: characters 3-6 : Warning : check pos