|
@@ -1,3 +1,4 @@
|
|
|
|
+import haxe.PosInfos;
|
|
import haxe.Exception;
|
|
import haxe.Exception;
|
|
import haxe.display.Position;
|
|
import haxe.display.Position;
|
|
import haxeserver.HaxeServerRequestResult;
|
|
import haxeserver.HaxeServerRequestResult;
|
|
@@ -195,6 +196,21 @@ class TestCase implements ITest {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function assertClassField(completion:CompletionResult, name:String, ?callback:(field:JsonClassField)->Void, ?pos:PosInfos) {
|
|
|
|
+ for (item in completion.result.items) {
|
|
|
|
+ switch item.kind {
|
|
|
|
+ case ClassField if(item.args.field.name == name):
|
|
|
|
+ switch callback {
|
|
|
|
+ case null: Assert.pass(pos);
|
|
|
|
+ case fn: fn(item.args.field);
|
|
|
|
+ }
|
|
|
|
+ return;
|
|
|
|
+ case _:
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Assert.fail(pos);
|
|
|
|
+ }
|
|
|
|
+
|
|
function assertHasCompletion<T>(completion:CompletionResult, f:DisplayItem<T>->Bool, ?p:haxe.PosInfos) {
|
|
function assertHasCompletion<T>(completion:CompletionResult, f:DisplayItem<T>->Bool, ?p:haxe.PosInfos) {
|
|
for (type in completion.result.items) {
|
|
for (type in completion.result.items) {
|
|
if (f(type)) {
|
|
if (f(type)) {
|