diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-10-24 15:25:27 +0200 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2023-11-15 20:19:18 +0100 |
commit | 981b9b10d6f48fb2768110a9f81a5f4e880406b2 (patch) | |
tree | 9d3afb2e9c65862fe70cc1e476b5f4ae87e45183 /test/buildtool/file_system/file_root.test.cpp | |
parent | fe907ca625657dce0e2f08f2129cf36c840602d3 (diff) | |
download | justbuild-981b9b10d6f48fb2768110a9f81a5f4e880406b2.tar.gz |
FileRoot: Add new absent root underlying type variant
Absent roots are characterised only by a Git tree hash, so a new
variant of the underlying stored information was added in the form
of a plain string.
In order to avoid unwanted implicit conversions when instantiating
via literal strings, we force callers of the constructors to
explicitly differentiate between plain strings and filesystem
paths. Existing tests were updated to reflect this.
Co-authored-by: Alberto Sartori <alberto.sartori@huawei.com>
Diffstat (limited to 'test/buildtool/file_system/file_root.test.cpp')
-rw-r--r-- | test/buildtool/file_system/file_root.test.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/buildtool/file_system/file_root.test.cpp b/test/buildtool/file_system/file_root.test.cpp index eab17ff6..8828fb7b 100644 --- a/test/buildtool/file_system/file_root.test.cpp +++ b/test/buildtool/file_system/file_root.test.cpp @@ -165,7 +165,8 @@ TEST_CASE("Creating file root", "[file_root]") { REQUIRE(root_path); CHECK(FileRoot{*root_path}.Exists(".")); - CHECK_FALSE(FileRoot{"does_not_exist"}.Exists(".")); + CHECK_FALSE( + FileRoot{std::filesystem::path{"does_not_exist"}}.Exists(".")); } SECTION("git root") { @@ -184,8 +185,9 @@ TEST_CASE("Creating file root", "[file_root]") { REQUIRE(root_path); CHECK(FileRoot{*root_path, /*ignore_special=*/true}.Exists(".")); - CHECK_FALSE( - FileRoot{"does_not_exist", /*ignore_special=*/true}.Exists(".")); + CHECK_FALSE(FileRoot{std::filesystem::path{"does_not_exist"}, + /*ignore_special=*/true} + .Exists(".")); } SECTION("git root ignore-special") { |