From 32abd3af68c611cd86c217e37f2ed21f0828998f Mon Sep 17 00:00:00 2001 From: Stephane Del Pino <stephane.delpino44@gmail.com> Date: Mon, 8 Jul 2019 11:26:30 +0200 Subject: [PATCH] Fix test reference for SymbolTable output clang-8 may write '(nil)' instead of '0' in output --- tests/test_SymbolTable.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/test_SymbolTable.cpp b/tests/test_SymbolTable.cpp index 9d7d02bde..38b0c1c82 100644 --- a/tests/test_SymbolTable.cpp +++ b/tests/test_SymbolTable.cpp @@ -24,11 +24,13 @@ TEST_CASE("SymbolTable", "[language]") std::stringstream st_output; st_output << '\n' << *root_st; - REQUIRE(st_output.str() == R"( --- Symbol table state -- parent : 0 - a: -- ------------------------- -)"); + std::stringstream expected_output; + expected_output << '\n' + << "-- Symbol table state -- parent : " << static_cast<SymbolTable*>(nullptr) << '\n' + << " a: --\n" + << "------------------------\n"; + + REQUIRE(st_output.str() == expected_output.str()); } SECTION("Attributes") @@ -68,11 +70,13 @@ TEST_CASE("SymbolTable", "[language]") std::stringstream st_output; st_output << '\n' << *root_st; - REQUIRE(st_output.str() == R"( --- Symbol table state -- parent : 0 - a: 2.3 ------------------------- -)"); + std::stringstream expected_output; + expected_output << '\n' + << "-- Symbol table state -- parent : " << static_cast<SymbolTable*>(nullptr) << '\n' + << " a: 2.3\n" + << "------------------------\n"; + + REQUIRE(st_output.str() == expected_output.str()); } } } -- GitLab