/* * 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 #include #include namespace facebook::react { TEST(CSSNumber, number_values) { auto emptyValue = parseCSSProperty(""); EXPECT_TRUE(std::holds_alternative(emptyValue)); auto pxValue = parseCSSProperty("20px"); EXPECT_TRUE(std::holds_alternative(pxValue)); auto numberValue = parseCSSProperty("123.456"); EXPECT_TRUE(std::holds_alternative(numberValue)); EXPECT_EQ(std::get(numberValue).value, 123.456f); auto exponentValue = parseCSSProperty("-1.5E3"); EXPECT_TRUE(std::holds_alternative(exponentValue)); EXPECT_EQ(std::get(exponentValue).value, -1.5E3f); } } // namespace facebook::react