diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-05-06 12:10:20 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-05-09 14:55:40 +0200 |
commit | 0e22c2c2261683a86619b1d715e497339f98a362 (patch) | |
tree | 2be0a8c45f667eb94e85b6c8e43986a550f4c1d4 /test/buildtool/build_engine/expression/expression.test.cpp | |
parent | 5d89525367527b659fe9732c4ed90b4e9c2f3658 (diff) | |
download | justbuild-0e22c2c2261683a86619b1d715e497339f98a362.tar.gz |
Built-in "to_subdir": interpret input keys as path
... and detect conflicts araising this way. Also normalize
the paths after staging them to the specified subdir.
Diffstat (limited to 'test/buildtool/build_engine/expression/expression.test.cpp')
-rw-r--r-- | test/buildtool/build_engine/expression/expression.test.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/buildtool/build_engine/expression/expression.test.cpp b/test/buildtool/build_engine/expression/expression.test.cpp index d80d8861..cbc8c7bf 100644 --- a/test/buildtool/build_engine/expression/expression.test.cpp +++ b/test/buildtool/build_engine/expression/expression.test.cpp @@ -1103,6 +1103,18 @@ TEST_CASE("Expression Evaluation", "[expression]") { // NOLINT R"({"prefix/foo": "hello", "prefix/bar": "world"})"_json)); } + SECTION("to_subdir expression with conflict") { + auto expr = Expression::FromJson(R"( + { "type": "to_subdir" + , "subdir": "prefix" + , "$1": { "type": "literal" + , "$1": { "foo": "hello" + , "./foo": "world" }}})"_json); + REQUIRE(expr); + + CHECK_FALSE(expr.Evaluate(env, fcts)); + } + SECTION("flat to_subdir without proper conflict") { auto expr = Expression::FromJson(R"( { "type": "to_subdir" |