mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibCodeComprehension: Prefer File::read_until_eof over DeprecatedFile
Note that LibTest/Macros.h and therefore the macro TRY_OR_FAIL are not available, so using these would require some in-depth rework. release_value_but_fixme_should_propagate_errors should generate a reasonably obvious hint that the test didn't find some expected file. Note that I intentionally did not choose MUST(), since it should be a TRY_OR_FAIL() in some form.
This commit is contained in:
parent
41b45d5599
commit
07dd719e3e
Notes:
sideshowbarker
2024-07-17 06:54:15 +09:00
Author: https://github.com/BenWiederhake
Commit: 07dd719e3e
Pull-request: https://github.com/SerenityOS/serenity/pull/18844
Reviewed-by: https://github.com/LucasChollet
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/krkk
1 changed files with 2 additions and 3 deletions
|
@ -89,9 +89,8 @@ int run_tests()
|
|||
|
||||
static void add_file(FileDB& filedb, DeprecatedString const& name)
|
||||
{
|
||||
auto file = Core::DeprecatedFile::open(LexicalPath::join(TESTS_ROOT_DIR, name).string(), Core::OpenMode::ReadOnly);
|
||||
VERIFY(!file.is_error());
|
||||
filedb.add(name, DeprecatedString::copy(file.value()->read_all()));
|
||||
auto file = Core::File::open(LexicalPath::join(TESTS_ROOT_DIR, name).string(), Core::File::OpenMode::Read).release_value_but_fixme_should_propagate_errors();
|
||||
filedb.add(name, DeprecatedString::copy(MUST(file->read_until_eof())));
|
||||
}
|
||||
|
||||
void test_complete_local_args()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue