Skip to content

Commit

Permalink
test: Test map matching for protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed May 12, 2024
1 parent 8dbac57 commit 3bd1304
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,26 @@ public function testInvoke(): void
'given' => $this->matcher->like($this->given),
'surname' => $this->matcher->like($this->surname),
],
'children' => $this->matcher->matchAll(
['Zane' => 12],
[
$this->matcher->eachKey(
[],
[$this->matcher->string()]
),
$this->matcher->eachValue(
[],
[
$this->matcher->number(23),
],
),
$this->matcher->atLeast(0),
$this->matcher->atMost(3),
// These matchers are allowed, but are not recommend
// $this->matcher->atLeastLike(123, 2),
// $this->matcher->atMostLike(234, 3),
],
),
]),
'application/protobuf'
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package library;
message Person {
string id = 1;
Name name = 2;
map<string, int32> children = 3;
}

message Name {
Expand Down

0 comments on commit 3bd1304

Please sign in to comment.