mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +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
|
@ -40,15 +40,17 @@ TEST_CASE(load_form)
|
|||
|
||||
EXPECT(form_json.is_object());
|
||||
|
||||
auto name = form_json.as_object().get_deprecated("name"sv).to_deprecated_string();
|
||||
auto name = form_json.as_object().get_deprecated_string("name"sv);
|
||||
EXPECT(name.has_value());
|
||||
|
||||
EXPECT_EQ(name, "Form1");
|
||||
EXPECT_EQ(name.value(), "Form1");
|
||||
|
||||
auto widgets = form_json.as_object().get_deprecated("widgets"sv).as_array();
|
||||
auto widgets = form_json.as_object().get_array("widgets"sv);
|
||||
EXPECT(widgets.has_value());
|
||||
|
||||
widgets.for_each([&](JsonValue const& widget_value) {
|
||||
widgets->for_each([&](JsonValue const& widget_value) {
|
||||
auto& widget_object = widget_value.as_object();
|
||||
auto widget_class = widget_object.get_deprecated("class"sv).as_string();
|
||||
auto widget_class = widget_object.get_deprecated_string("class"sv).value();
|
||||
widget_object.for_each_member([&]([[maybe_unused]] auto& property_name, [[maybe_unused]] const JsonValue& property_value) {
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue