From 8f2e3e7af0360cca7f8918ae41cc573f8cd88d7f Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Mon, 9 Nov 2020 16:55:10 +0100 Subject: Support empty translation unit --- tests/test-cpp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-cpp.cpp b/tests/test-cpp.cpp index 0a0276e..e80f2d6 100644 --- a/tests/test-cpp.cpp +++ b/tests/test-cpp.cpp @@ -57,7 +57,9 @@ TEST_F(CppTest, preprocessing_tokenize_empty) { auto nodes = cpp.analysis(tokens); - ASSERT_EQ(nodes.size(), 0); + ASSERT_EQ(nodes.size(), 1); + + ASSERT_EQ(nodes[0].type, "translation-unit"); } TEST_F(CppTest, preprocessing_tokenize_compile_error) { -- cgit v1.2.3