Skip to content

Commit

Permalink
added testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Apr 12, 2020
1 parent 36935e2 commit 131ef6f
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/tokentree/TokenTreeBuilderParsingTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ class TokenTreeBuilderParsingTest {
@Test
public function testIssues4() {
assertCodeParses(MODULE_LEVEL_STATIC);
assertCodeParses(SWITCH_INDENTATION);
assertCodeParses(METADATA_DOC_COMMENT);
}

public function assertCodeParses(code:String, ?pos:PosInfos) {
Expand Down Expand Up @@ -1523,4 +1525,34 @@ import #if haxe4 js.lib.Promise #else js.Promise #end as JsPromise;
}
}
";

var SWITCH_INDENTATION = "
class InitProject {
function initProject() {
switch workspace.workspaceFolders {
case null | []:
window.showOpenDialog({
canSelectFolders: true,
canSelectFiles: false
}).then(folders -> {
if (folders != null && folders.length > 0) {
setupFolder(folders[0].fsPath);
commands.executeCommand('vscode.openFolder', folders[0]);
}
});
case [folder]:
setupFolder(folder.uri.fsPath);
}
}
function setupFolder(fsPath:String) {}
}
";

var METADATA_DOC_COMMENT = "
@:jsRequire('openfl/display/Bitmap', 'default') /**
* The Bitmap class represents display objects that represent bitmap images.
*/
extern class Bitmap extends DisplayObject {}
";
}

0 comments on commit 131ef6f

Please sign in to comment.