evaluate

  1. auto evaluate(T testData)
  2. auto evaluate(T testData)
    @trusted
    evaluate
    (
    T
    )
    (
    lazy T testData
    )
    if (
    !isInputRange!T ||
    isArray!T
    ||
    isAssociativeArray!T
    )

Examples

evaluate a lazy value should capture an exception

int value() {
  throw new Exception("message");
}

auto result = evaluate(value);

assert(result.evaluation.throwable !is null);
assert(result.evaluation.throwable.msg == "message");

evaluate should capture an exception thrown by a callable

void value() {
  throw new Exception("message");
}

auto result = evaluate(&value);

assert(result.evaluation.throwable !is null);
assert(result.evaluation.throwable.msg == "message");

Meta