1
0

単体テストを追加

This commit is contained in:
otya128
2015-06-03 19:56:34 +09:00
parent 6673ca3fc2
commit 35086e62db
3 changed files with 23 additions and 11 deletions

View File

@@ -51,8 +51,22 @@ class Lexical
}
unittest
{
auto lex = new Lexical("1");
{
auto lex = new Lexical("1");
assert(lex.empty() == false);
lex.popFront();
auto token = lex.front();
assert(token.type == TokenType.Integer);
assert(token.value.integerValue == 1);
}
{
auto lex = new Lexical("12345");
assert(lex.empty() == false);
lex.popFront();
auto token = lex.front();
assert(token.type == TokenType.Integer);
assert(token.value.integerValue == 12345);
}
}
class Parser
{