Skip to content

Commit

Permalink
[tests] Check metadata from JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
ricab committed Nov 22, 2023
1 parent 60536b1 commit dc5a04b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_base_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,26 @@ TEST_F(TestBaseSnapshot, adoptsStateFromJson)
auto snapshot = MockBaseSnapshot{plant_snapshot_json(json), vm};
EXPECT_EQ(snapshot.get_state(), state);
}

TEST_F(TestBaseSnapshot, adoptsMetadataFromJson)
{
auto metadata = QJsonObject{};
metadata["arguments"] = "Meathook:\n"
"You've got a real attitude problem!\n"
"\n"
"Guybrush Threepwood:\n"
"Well... you've got a real hair problem!\n"
"\n"
"Meathook:\n"
"You just don't know when to quit, do you?\n"
"\n"
"Guybrush Threepwood:\n"
"Neither did your barber.";

auto json = test_snapshot_json();
mod_snapshot_json(json, "metadata", metadata);

auto snapshot = MockBaseSnapshot{plant_snapshot_json(json), vm};
EXPECT_EQ(snapshot.get_metadata(), metadata);
}
} // namespace

0 comments on commit dc5a04b

Please sign in to comment.