From a74268b59a01fad23bb179b345d935334a5d968e Mon Sep 17 00:00:00 2001 From: otya128 Date: Wed, 3 Jun 2015 19:58:07 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8D=98=E4=BD=93=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=81=AE=E5=86=85=E5=AE=B9=E3=82=92=E5=A2=97=E3=82=84=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMILEBASIC/parser.d | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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