mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 12:45:37 +08:00
Fabric: Enabling clang-format for the rest of Fabric
Summary: This is the second and the final part of adopting clang-format. Reviewed By: mdvacca Differential Revision: D10229624 fbshipit-source-id: d97670b716800ea2488b84bd0aacaf54d8bd2e31
This commit is contained in:
committed by
Facebook Github Bot
parent
01af828d16
commit
8f51243957
@@ -14,7 +14,8 @@ using namespace facebook::react;
|
||||
|
||||
TEST(DebugStringConvertibleTest, handleSimpleNode) {
|
||||
SharedDebugStringConvertibleList empty;
|
||||
auto item = std::make_shared<DebugStringConvertibleItem>("View", "hello", empty, empty);
|
||||
auto item = std::make_shared<DebugStringConvertibleItem>(
|
||||
"View", "hello", empty, empty);
|
||||
|
||||
ASSERT_STREQ(item->getDebugName().c_str(), "View");
|
||||
ASSERT_STREQ(item->getDebugValue().c_str(), "hello");
|
||||
@@ -24,9 +25,9 @@ TEST(DebugStringConvertibleTest, handleSimpleNode) {
|
||||
TEST(DebugStringConvertibleTest, handleSimpleNodeWithProps) {
|
||||
SharedDebugStringConvertibleList empty;
|
||||
SharedDebugStringConvertibleList props = {
|
||||
std::make_shared<DebugStringConvertibleItem>("x", "1", empty, empty)
|
||||
};
|
||||
auto item = std::make_shared<DebugStringConvertibleItem>("View", "hello", props, empty);
|
||||
std::make_shared<DebugStringConvertibleItem>("x", "1", empty, empty)};
|
||||
auto item = std::make_shared<DebugStringConvertibleItem>(
|
||||
"View", "hello", props, empty);
|
||||
|
||||
ASSERT_STREQ(item->getDebugName().c_str(), "View");
|
||||
ASSERT_STREQ(item->getDebugValue().c_str(), "hello");
|
||||
@@ -36,42 +37,48 @@ TEST(DebugStringConvertibleTest, handleSimpleNodeWithProps) {
|
||||
TEST(DebugStringConvertibleTest, handleSimpleNodeWithChildren) {
|
||||
SharedDebugStringConvertibleList empty;
|
||||
SharedDebugStringConvertibleList children = {
|
||||
std::make_shared<DebugStringConvertibleItem>("Child", "a", empty, empty)
|
||||
};
|
||||
auto item = std::make_shared<DebugStringConvertibleItem>("View", "hello", empty, children);
|
||||
std::make_shared<DebugStringConvertibleItem>("Child", "a", empty, empty)};
|
||||
auto item = std::make_shared<DebugStringConvertibleItem>(
|
||||
"View", "hello", empty, children);
|
||||
|
||||
ASSERT_STREQ(item->getDebugName().c_str(), "View");
|
||||
ASSERT_STREQ(item->getDebugValue().c_str(), "hello");
|
||||
ASSERT_STREQ(item->getDebugDescription().c_str(), "<View=hello>\n <Child=a/>\n</View>\n");
|
||||
ASSERT_STREQ(
|
||||
item->getDebugDescription().c_str(),
|
||||
"<View=hello>\n <Child=a/>\n</View>\n");
|
||||
}
|
||||
|
||||
TEST(DebugStringConvertibleTest, handleNestedNode) {
|
||||
SharedDebugStringConvertibleList empty;
|
||||
SharedDebugStringConvertibleList props = {
|
||||
std::make_shared<DebugStringConvertibleItem>("x", "1", empty, empty)
|
||||
};
|
||||
std::make_shared<DebugStringConvertibleItem>("x", "1", empty, empty)};
|
||||
SharedDebugStringConvertibleList children = {
|
||||
std::make_shared<DebugStringConvertibleItem>("Child", "a", props, empty)
|
||||
};
|
||||
auto item = std::make_shared<DebugStringConvertibleItem>("View", "hello", props, children);
|
||||
std::make_shared<DebugStringConvertibleItem>("Child", "a", props, empty)};
|
||||
auto item = std::make_shared<DebugStringConvertibleItem>(
|
||||
"View", "hello", props, children);
|
||||
|
||||
ASSERT_STREQ(item->getDebugName().c_str(), "View");
|
||||
ASSERT_STREQ(item->getDebugValue().c_str(), "hello");
|
||||
ASSERT_STREQ(item->getDebugDescription().c_str(), "<View=hello x=1>\n <Child=a x=1/>\n</View>\n");
|
||||
ASSERT_STREQ(
|
||||
item->getDebugDescription().c_str(),
|
||||
"<View=hello x=1>\n <Child=a x=1/>\n</View>\n");
|
||||
}
|
||||
|
||||
TEST(DebugStringConvertibleTest, handleNodeWithComplexProps) {
|
||||
SharedDebugStringConvertibleList empty;
|
||||
SharedDebugStringConvertibleList subProps = {
|
||||
std::make_shared<DebugStringConvertibleItem>("height", "100", empty, empty),
|
||||
std::make_shared<DebugStringConvertibleItem>("width", "200", empty, empty)
|
||||
};
|
||||
std::make_shared<DebugStringConvertibleItem>(
|
||||
"height", "100", empty, empty),
|
||||
std::make_shared<DebugStringConvertibleItem>(
|
||||
"width", "200", empty, empty)};
|
||||
SharedDebugStringConvertibleList props = {
|
||||
std::make_shared<DebugStringConvertibleItem>("x", "1", subProps, empty)
|
||||
};
|
||||
auto item = std::make_shared<DebugStringConvertibleItem>("View", "hello", props, empty);
|
||||
std::make_shared<DebugStringConvertibleItem>("x", "1", subProps, empty)};
|
||||
auto item = std::make_shared<DebugStringConvertibleItem>(
|
||||
"View", "hello", props, empty);
|
||||
|
||||
ASSERT_STREQ(item->getDebugName().c_str(), "View");
|
||||
ASSERT_STREQ(item->getDebugValue().c_str(), "hello");
|
||||
ASSERT_STREQ(item->getDebugDescription().c_str(), "<View=hello x=1(height=100 width=200)/>\n");
|
||||
ASSERT_STREQ(
|
||||
item->getDebugDescription().c_str(),
|
||||
"<View=hello x=1(height=100 width=200)/>\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user