mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Fixes
+ Fixed build for mac + Removed undefined properties from tests
This commit is contained in:
committed by
Mikhail Lobotskiy
parent
c23eece6ae
commit
84c34eed65
@ -14,9 +14,9 @@ namespace NSJSON
|
||||
{
|
||||
class IBaseValue;
|
||||
// Transform C++ value to JS value
|
||||
JSSmart<NSJSBase::CJSValue> toJS(const IBaseValue* pValue);
|
||||
static JSSmart<NSJSBase::CJSValue> toJS(const IBaseValue* pValue);
|
||||
// Transform JS value to C++ value
|
||||
IBaseValue* fromJS(JSSmart<NSJSBase::CJSValue> jsValue);
|
||||
static IBaseValue* fromJS(JSSmart<NSJSBase::CJSValue> jsValue);
|
||||
|
||||
class JS_DECL IBaseValue
|
||||
{
|
||||
|
||||
@ -87,14 +87,21 @@ TEST_F(CGetPropertyNamesTest, inner_object)
|
||||
TEST_F(CGetPropertyNamesTest, object_with_null_and_undefined_properties)
|
||||
{
|
||||
std::vector<std::string> result = getObjectProperties("{number: null, name: undefined, func() { return 'bar'; }}");
|
||||
std::vector<std::string> expected = {"number", "name", "func"};
|
||||
std::vector<std::string> expected = {"number", "func"};
|
||||
EXPECT_TRUE(compare(result, expected)) << printInfo("Actual: ", result) << printInfo("Expected: ", expected);
|
||||
}
|
||||
|
||||
TEST_F(CGetPropertyNamesTest, object_with_only_undefined_properties)
|
||||
{
|
||||
std::vector<std::string> result = getObjectProperties("{foo: undefined, bar: undefined}");
|
||||
std::vector<std::string> expected = {};
|
||||
EXPECT_TRUE(compare(result, expected)) << printInfo("Actual: ", result) << printInfo("Expected: ", expected);
|
||||
}
|
||||
|
||||
TEST_F(CGetPropertyNamesTest, array_as_object)
|
||||
{
|
||||
std::vector<std::string> result = getObjectProperties("{0: 4, 1: 2, 2: undefined, 3: 'foo', 42: 'bar'}");
|
||||
std::vector<std::string> expected = {"0", "1", "2", "3", "42"};
|
||||
std::vector<std::string> expected = {"0", "1", "3", "42"};
|
||||
EXPECT_TRUE(compare(result, expected)) << printInfo("Actual: ", result) << printInfo("Expected: ", expected);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user