[Yunq] Add basic test for repeated fields.

This commit is contained in:
Drew Galbraith 2024-01-17 15:15:55 -08:00
parent 65e9fa1767
commit 27c39d05e8
5 changed files with 80 additions and 1 deletions

View file

@ -86,3 +86,15 @@ TEST_CASE("Cap Serialization Sidebuffer", "[yunq]") {
REQUIRE(b.cap() == 1234);
}
TEST_CASE("Repeated Setter/Getter", "[yunq]") {
ex::Repeated r;
r.mutable_unsigned_ints().PushBack(1);
r.add_unsigned_ints(2);
uint64_t c = 3;
r.add_unsigned_ints(glcr::Move(c));
REQUIRE(r.unsigned_ints()[0] == 1);
REQUIRE(r.unsigned_ints()[1] == 2);
REQUIRE(r.unsigned_ints()[2] == 3);
}