From 97bd521804d8b54230ec114c2dddf64c6c491dde Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 4 Jun 2025 14:15:01 +0200 Subject: directory_map: Correctly report fatal on failures to read from workspace roots --- test/buildtool/file_system/file_root.test.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'test/buildtool/file_system/file_root.test.cpp') diff --git a/test/buildtool/file_system/file_root.test.cpp b/test/buildtool/file_system/file_root.test.cpp index 46b52e79..789eea08 100644 --- a/test/buildtool/file_system/file_root.test.cpp +++ b/test/buildtool/file_system/file_root.test.cpp @@ -134,19 +134,20 @@ void TestFileRootReadEntries(FileRoot const& root, REQUIRE(root.Exists(path)); REQUIRE(root.IsDirectory(path)); auto entries = root.ReadDirectory(path); + REQUIRE(entries.has_value()); - CHECK_FALSE(entries.Empty()); - CHECK(entries.ContainsBlob("foo")); - CHECK(entries.ContainsBlob("bar")); + CHECK_FALSE(entries->Empty()); + CHECK(entries->ContainsBlob("foo")); + CHECK(entries->ContainsBlob("bar")); if (has_baz) { - CHECK_FALSE(entries.ContainsBlob("baz")); - CHECK(with_symlinks == entries.ContainsBlob("baz_l")); - CHECK(with_symlinks == entries.ContainsBlob("foo_l")); + CHECK_FALSE(entries->ContainsBlob("baz")); + CHECK(with_symlinks == entries->ContainsBlob("baz_l")); + CHECK(with_symlinks == entries->ContainsBlob("foo_l")); } else { - CHECK(with_symlinks == entries.ContainsBlob("bar_l")); + CHECK(with_symlinks == entries->ContainsBlob("bar_l")); } - CHECK_FALSE(entries.ContainsBlob("does_not_exist")); + CHECK_FALSE(entries->ContainsBlob("does_not_exist")); } void TestFileRootReadDirectory(FileRoot const& root, bool with_symlinks) { -- cgit v1.2.3