GPU Expressions (#2202)

This commit is contained in:
Tim Sylvester
2024-05-17 07:30:55 -07:00
committed by GitHub
parent b812e97aaf
commit 33a1e162bc
64 changed files with 2336 additions and 318 deletions

View File

@@ -39,7 +39,15 @@ TEST(ExpressionDependencies, Convert) {
EXPECT_EQ(Dependency::Feature, toString(number(string(get("color"))))->dependencies);
EXPECT_EQ(Dependency::Feature, boolean(string(get("color")))->dependencies);
EXPECT_EQ(Dependency::Feature, toFormatted(toColor(string(get("color"))))->dependencies);
EXPECT_EQ(Dependency::Feature | Dependency::Image, toImage(string(get("color")))->dependencies);
/// See `coercion.cpp`, `extraDependency`
EXPECT_EQ(Dependency::Feature, toImage(string(get("color")))->dependencies);
/// See `collator_expression.cpp`, `extraDependency`
EXPECT_EQ(Dependency::Feature,
createExpression(R"(["resolved-locale",["collator",{"locale": "de"}]])")->dependencies);
EXPECT_EQ(Dependency::Feature | Dependency::Zoom,
CollatorExpression(gt(literal(1.), zoom()), literal(true), literal("en-us")).dependencies);
}
TEST(ExpressionDependencies, Compare) {
@@ -78,8 +86,3 @@ TEST(ExpressionDependencies, CustomLayer) {
auto impl = makeMutable<CustomLayer::Impl>("", nullptr);
EXPECT_EQ(Dependency::None, CustomLayerProperties{std::move(impl)}.getDependencies());
}
TEST(ExpressionDependencies, Collation) {
auto collator = CollatorExpression(gt(literal(1.), zoom()), literal(true), literal("en-us"));
EXPECT_EQ(Dependency::Feature | Dependency::Zoom, collator.dependencies);
}