callTest method

  1. @internal
bool callTest(
  1. String name,
  2. List<Object?> positional, [
  3. Map<Symbol, Object?> named = const <Symbol, Object?>{},
  4. Context? context,
])

If name not found throws TemplateRuntimeError.

Implementation

@internal
bool callTest(
  String name,
  List<Object?> positional, [
  Map<Symbol, Object?> named = const <Symbol, Object?>{},
  Context? context,
]) {
  if (tests[name] case var function?) {
    return callCommon(function, positional, named, context) as bool;
  }

  throw TemplateRuntimeError("No test named '$name'.");
}