44 lines
1.4 KiB
C++
44 lines
1.4 KiB
C++
/**
|
|
* @author Edouard DUPIN
|
|
* @copyright 2017, Edouard DUPIN, all right reserved
|
|
* @license MPL-2 (see license file)
|
|
*/
|
|
#include <test-debug/debug.hpp>
|
|
#include <etest/etest.hpp>
|
|
#include "testInterface.hpp"
|
|
|
|
|
|
TEST(testComment, singleLine) {
|
|
testInterface system;
|
|
bool ret = system.execute("// result = true; \n variable hello=9;");
|
|
EXPECT_EQ(ret, true);
|
|
EXPECT_EQ(system.exist("result"), false);
|
|
}
|
|
|
|
|
|
TEST(testComment, multipleLine) {
|
|
testInterface system;
|
|
bool ret = system.execute("var result2 = false; \n /* var result \n = \n true; \n result = 8; \n */ var result = 118;");
|
|
EXPECT_EQ(ret, true);
|
|
EXPECT_EQ(system.exist("result2"), true);
|
|
EXPECT_EQ(system.exist("result"), true);
|
|
EXPECT_EQ(system.getBoolean("result2"), false);
|
|
EXPECT_EQ(system.getInteger32("result"), 118);
|
|
}
|
|
|
|
TEST(testDocumentation, singleLine) {
|
|
testInterface system;
|
|
bool ret = system.execute("//! result = true; \n variable hello=9;");
|
|
EXPECT_EQ(ret, true);
|
|
EXPECT_EQ(system.exist("result"), false);
|
|
}
|
|
|
|
TEST(testDocumentation, multipleLine) {
|
|
testInterface system;
|
|
bool ret = system.execute("var result2 = false; \n /** var result \n = \n true; \n result = 8; \n */ var result = 118;");
|
|
EXPECT_EQ(ret, true);
|
|
EXPECT_EQ(system.exist("result2"), true);
|
|
EXPECT_EQ(system.exist("result"), true);
|
|
EXPECT_EQ(system.getBoolean("result2"), false);
|
|
EXPECT_EQ(system.getInteger32("result"), 118);
|
|
} |