Added unittest for identifiers

This commit is contained in:
Tristan B. Velloza Kildaire 2021-03-05 12:12:05 +02:00
parent bfdbaaeee7
commit 2b7dd2fce3
1 changed files with 12 additions and 1 deletions

View File

@ -317,4 +317,15 @@ unittest
symbol = getSymbolType(new Token("2121a", 0, 0));
assert(symbol != SymbolType.NUMBER_LITERAL);
}
}
/* Test: Identifer tests */
unittest
{
SymbolType symbol = getSymbolType(new Token("_yolo2", 0, 0));
assert(symbol == SymbolType.IDENTIFIER);
symbol = getSymbolType(new Token("2_2ff", 0, 0));
assert(symbol != SymbolType.IDENTIFIER);
}