check static method
Implementation
static void check(
Token? tok,
TokenType type, [
String? text,
int lineNum = 0,
]) {
UnitTest.errorIfNull(tok);
if (tok == null) return;
UnitTest.errorIf(
tok.type != type,
"Token type: expected $type, but got ${tok.type}",
);
UnitTest.errorIf(
text != null && tok.text != text,
"Token text: expected $text, but got ${tok.text}",
);
}