mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:47:35 +00:00
Tests: Replace uses of JsonObject::get_deprecated()/get_ptr()
This commit is contained in:
parent
ad9b2043dd
commit
d55f763fcd
4 changed files with 18 additions and 16 deletions
|
@ -269,8 +269,8 @@ static ErrorOr<HashMap<size_t, TestResult>> run_test_files(Span<DeprecatedString
|
|||
auto result_object_or_error = parser.parse();
|
||||
if (!result_object_or_error.is_error() && result_object_or_error.value().is_object()) {
|
||||
auto& result_object = result_object_or_error.value().as_object();
|
||||
if (auto result_string = result_object.get_ptr("result"sv); result_string && result_string->is_string()) {
|
||||
auto const& view = result_string->as_string();
|
||||
if (auto result_string = result_object.get_deprecated_string("result"sv); result_string.has_value()) {
|
||||
auto const& view = result_string.value();
|
||||
// Timeout and assert fail already are the result of the stopping test
|
||||
if (view == "timeout"sv || view == "assert_fail"sv) {
|
||||
failed = false;
|
||||
|
|
|
@ -432,9 +432,9 @@ static bool verify_test(Result<void, TestError>& result, TestMetadata const& met
|
|||
}
|
||||
|
||||
if (metadata.is_async && output.has("output"sv)) {
|
||||
auto& output_messages = output.get_deprecated("output"sv);
|
||||
VERIFY(output_messages.is_string());
|
||||
if (output_messages.as_string().contains("AsyncTestFailure:InternalError: TODO("sv)) {
|
||||
auto output_messages = output.get_deprecated_string("output"sv);
|
||||
VERIFY(output_messages.has_value());
|
||||
if (output_messages->contains("AsyncTestFailure:InternalError: TODO("sv)) {
|
||||
output.set("todo_error", true);
|
||||
output.set("result", "todo_error");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue