Files
yoga/tests/OrdinalsTest.cpp
Nick Gerleman c7c81e3c89 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
2023-11-21 23:17:32 -08:00

36 lines
719 B
C++

/*
* 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