From c0c3353fd7b569463fd7c8febfcf29ceb2d858f4 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 6 Jul 2021 12:06:07 -0400 Subject: [PATCH] Test lexing empty null string returns EOF --- spec/test_d_lexer.d | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/test_d_lexer.d b/spec/test_d_lexer.d index cd4649c..d03f9ae 100644 --- a/spec/test_d_lexer.d +++ b/spec/test_d_lexer.d @@ -60,4 +60,7 @@ unittest assert(lexer.lex_token() == LT(1, 4, 1, Testparser.TOKEN_PLUS)); assert(lexer.lex_token() == LT(1, 6, 3, Testparser.TOKEN_INT)); assert(lexer.lex_token() == LT(1, 9, 0, Testparser.TOKEN_EOF)); + + lexer = new Testparser.Lexer(null, 0u); + assert(lexer.lex_token() == LT(0, 0, 0, Testparser.TOKEN_EOF)); }