JS test minor: use getNamedArgument for mandatory directive arguments
This commit is contained in:
@@ -94,10 +94,9 @@ public class DirectiveTestUtils {
|
|||||||
private static final DirectiveHandler COUNT_LABELS = new DirectiveHandler("CHECK_LABELS_COUNT") {
|
private static final DirectiveHandler COUNT_LABELS = new DirectiveHandler("CHECK_LABELS_COUNT") {
|
||||||
@Override
|
@Override
|
||||||
void processEntry(@NotNull JsNode ast, @NotNull ArgumentsHelper arguments) throws Exception {
|
void processEntry(@NotNull JsNode ast, @NotNull ArgumentsHelper arguments) throws Exception {
|
||||||
String functionName = arguments.findNamedArgument("function");
|
String functionName = arguments.getNamedArgument("function");
|
||||||
String labelName = arguments.findNamedArgument("name");
|
String labelName = arguments.getNamedArgument("name");
|
||||||
String countStr = arguments.findNamedArgument("count");
|
String countStr = arguments.getNamedArgument("count");
|
||||||
assert countStr != null;
|
|
||||||
int expectedCount = Integer.valueOf(countStr);
|
int expectedCount = Integer.valueOf(countStr);
|
||||||
|
|
||||||
JsNode scope = AstSearchUtil.getFunction(ast, functionName);
|
JsNode scope = AstSearchUtil.getFunction(ast, functionName);
|
||||||
@@ -195,6 +194,11 @@ public class DirectiveTestUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abstract void processEntry(@NotNull JsNode ast, @NotNull ArgumentsHelper arguments) throws Exception;
|
abstract void processEntry(@NotNull JsNode ast, @NotNull ArgumentsHelper arguments) throws Exception;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
String getName() {
|
||||||
|
return directive;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user