@@ -25,6 +25,22 @@ int main() {
a.expect_eq(uv.resolve(0, 0), 0);
});
s.add_test("unit/ex", [](etest::IActions &a) {
// Based on the first argument, the current element's font-size.
auto const uv = layout::UnresolvedValue{.raw = "1ex"};
a.expect_eq(uv.resolve(100, 100), 50);
a.expect_eq(uv.resolve(123, 456), 61);
a.expect_eq(uv.resolve(0, 0), 0);
});
s.add_test("unit/ch", [](etest::IActions &a) {
// Based on the first argument, the current element's font-size.
auto const uv = layout::UnresolvedValue{.raw = "1ch"};
a.expect_eq(uv.resolve(100, 100), 50);
a.expect_eq(uv.resolve(123, 456), 61);
a.expect_eq(uv.resolve(0, 0), 0);
});
s.add_test("unit/rem", [](etest::IActions &a) {
// Based on the second argument, the root element's font-size.
auto const uv = layout::UnresolvedValue{.raw = "2rem"};