diff --git a/SMILEBASIC/parser.d b/SMILEBASIC/parser.d index 426040c..32754ff 100644 --- a/SMILEBASIC/parser.d +++ b/SMILEBASIC/parser.d @@ -58,6 +58,7 @@ unittest auto token = lex.front(); assert(token.type == TokenType.Integer); assert(token.value.integerValue == 1); + assert(lex.empty() == true); } { auto lex = new Lexical("12345"); @@ -66,6 +67,21 @@ unittest auto token = lex.front(); assert(token.type == TokenType.Integer); assert(token.value.integerValue == 12345); + assert(lex.empty() == true); + } + { + auto lex = new Lexical("12345 67890"); + assert(lex.empty() == false); + lex.popFront(); + auto token = lex.front(); + assert(token.type == TokenType.Integer); + assert(token.value.integerValue == 12345); + assert(lex.empty() == false); + lex.popFront(); + token = lex.front(); + assert(token.type == TokenType.Integer); + assert(token.value.integerValue == 67890); + assert(lex.empty() == true); } } class Parser