diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2024-06-27 17:22:32 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2024-06-28 11:24:09 +0200 |
commit | ed7e81b9aefaa47e61983d14c2447bbd1f5c95c5 (patch) | |
tree | 366dc9ab8809cc05f4354c2007bd47281a7c2974 /test/buildtool/file_system/git_repo.test.cpp | |
parent | 956ed669cf71d1ee74dbb573c542a7565c3a90d3 (diff) | |
download | justbuild-ed7e81b9aefaa47e61983d14c2447bbd1f5c95c5.tar.gz |
Use (un)expected for Git repo
Diffstat (limited to 'test/buildtool/file_system/git_repo.test.cpp')
-rw-r--r-- | test/buildtool/file_system/git_repo.test.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/buildtool/file_system/git_repo.test.cpp b/test/buildtool/file_system/git_repo.test.cpp index 67ad19cd..c5265aaf 100644 --- a/test/buildtool/file_system/git_repo.test.cpp +++ b/test/buildtool/file_system/git_repo.test.cpp @@ -19,7 +19,6 @@ #include <optional> #include <string> #include <thread> -#include <variant> #include <vector> #include "catch2/catch_test_macros.hpp" @@ -468,15 +467,15 @@ TEST_CASE("Single-threaded fake repository operations -- batch 2", SECTION("Get base tree id") { auto entry_root_c = repo->GetSubtreeFromCommit(kRootCommit, ".", logger); - REQUIRE(std::holds_alternative<std::string>(entry_root_c)); - CHECK(std::get<std::string>(entry_root_c) == kRootId); + REQUIRE(entry_root_c); + CHECK(*entry_root_c == kRootId); } SECTION("Get inner tree id") { auto entry_baz_c = repo->GetSubtreeFromCommit(kRootCommit, "baz", logger); - REQUIRE(std::holds_alternative<std::string>(entry_baz_c)); - CHECK(std::get<std::string>(entry_baz_c) == kBazId); + REQUIRE(entry_baz_c); + CHECK(*entry_baz_c == kBazId); } } @@ -621,9 +620,8 @@ TEST_CASE("Multi-threaded fake repository operations", "[git_repo]") { auto entry_baz_c = remote_repo->GetSubtreeFromCommit( kRootCommit, "baz", logger); - REQUIRE(std::holds_alternative<std::string>( - entry_baz_c)); - CHECK(std::get<std::string>(entry_baz_c) == kBazId); + REQUIRE(entry_baz_c); + CHECK(*entry_baz_c == kBazId); } break; case 1: { auto remote_repo = GitRepo::Open(remote_cas); |