forked from HaxeFoundation/haxe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] check for range too for HaxeFoundation#7282
- Loading branch information
Showing
2 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
package cases.issues; | ||
|
||
import haxe.display.Diagnostic; | ||
|
||
class Issue7282 extends TestCase { | ||
function test(_) { | ||
vfs.putContent("Main.hx", getTemplate("issues/Issue7282/Main.hx")); | ||
var content = getTemplate("issues/Issue7282/Main.hx"); | ||
var transform = Markers.parse(content); | ||
|
||
vfs.putContent("Main.hx", transform.source); | ||
var args = ["-main", "Main"]; | ||
runHaxe(args); | ||
assertSuccess(); | ||
runHaxeJsonCb(args, DisplayMethods.Diagnostics, {file: new FsPath("Main.hx")}, res -> { | ||
Assert.equals("Unused variable", (cast res[0].diagnostics[0].args).description); | ||
var arg:ReplacableCode = res[0].diagnostics[0].args; | ||
Assert.equals("Unused variable", arg.description); | ||
Assert.same(transform.range(1,2), res[0].diagnostics[0].range); | ||
Assert.same(transform.range(1,2), arg.range); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters