expectProblemType<T> function
Assert result is an Err whose problem has type; returns the problem.
Implementation
Problem expectProblemType<T>(Result<T> result, String type) {
final Problem problem = expectErr(result);
if (problem.type != type) {
throw AssertionError(
'expected problem type "$type" but got "${problem.type}"',
);
}
return problem;
}