From 359511c5a6db875b62f78e21dca557b15501e879 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Wed, 12 Oct 2022 21:08:33 +0300 Subject: Fixed build with GCC --- JSImpl/test/ASTInterpreterTests.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'JSImpl/test/ASTInterpreterTests.cpp') diff --git a/JSImpl/test/ASTInterpreterTests.cpp b/JSImpl/test/ASTInterpreterTests.cpp index e8cf282..d431de0 100644 --- a/JSImpl/test/ASTInterpreterTests.cpp +++ b/JSImpl/test/ASTInterpreterTests.cpp @@ -25,6 +25,11 @@ struct ASTInterpret : ::testing::Test return std::get(*Interpreter.ModifyVariable(name)); } + bool ValueAsBool(const char* name) + { + return std::get(*Interpreter.ModifyVariable(name)); + } + IPLString ValueAsString(const char* name) { return std::get(*Interpreter.ModifyVariable(name)); @@ -61,14 +66,14 @@ TEST_F(ASTInterpret, LessNumber) { Run("var answer = 6 < 7"); ASSERT_TRUE(HasVariable("answer")); - ASSERT_DOUBLE_EQ(ValueAsNumber("answer"), 1.0); + ASSERT_TRUE(ValueAsBool("answer")); } TEST_F(ASTInterpret, LessString) { Run("var name = 'John' < 'Doe'"); ASSERT_TRUE(HasVariable("name")); - ASSERT_DOUBLE_EQ(ValueAsNumber("name"), 0.0); + ASSERT_FALSE(ValueAsBool("name")); } TEST_F(ASTInterpret, StringLessNumber) -- cgit v1.3.1-23-gd82d