Remove composite border comparisons (#1475)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1475 X-link: https://github.com/facebook/react-native/pull/41568 Removes cases where we rely on comparing composite of Yoga edges, since we are removing that internal API (public API is already one at a time). Extracted from D50998164, with more sound facility for looping through edges. Changelog: [Internal] Reviewed By: javache Differential Revision: D51478403 fbshipit-source-id: 162170b91345ff86db44a49a04a2345f0fbd0911
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a713a598c8
commit
c7c81e3c89
35
tests/OrdinalsTest.cpp
Normal file
35
tests/OrdinalsTest.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <deque>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <yoga/enums/Edge.h>
|
||||
|
||||
namespace facebook::yoga {
|
||||
|
||||
TEST(Ordinals, iteration) {
|
||||
std::deque expectedEdges{
|
||||
Edge::Left,
|
||||
Edge::Top,
|
||||
Edge::Right,
|
||||
Edge::Bottom,
|
||||
Edge::Start,
|
||||
Edge::End,
|
||||
Edge::Horizontal,
|
||||
Edge::Vertical,
|
||||
Edge::All};
|
||||
|
||||
for (auto edge : yoga::ordinals<Edge>()) {
|
||||
ASSERT_EQ(edge, expectedEdges.front());
|
||||
expectedEdges.pop_front();
|
||||
}
|
||||
|
||||
ASSERT_TRUE(expectedEdges.empty());
|
||||
}
|
||||
|
||||
} // namespace facebook::yoga
|
Reference in New Issue
Block a user