Skip to content

Commit

Permalink
proto: refactor equal_test from explicit table to use makeMessages()
Browse files Browse the repository at this point in the history
This is important for test coverage: the makeMessages() function is where we
declare the various different test message types. Using this central function is
better than explicitly having to spell out all the various cases in the test
table.

This CL is roughly neutral in terms of lines changed, but actually increases
coverage: in the existing table, not every group of tests had coverage for all
cases (proto2, proto3, editions). This was difficult to spot previously, but now
the different test message types are now clearly spelled out (allTypesNoProto3).

Also, the test now prints the description and message types as subtest name.
This makes it easy to verify coverage by just reading the test output.

Change-Id: I08f541548d087233cbb4686785c456674371c2a3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/623115
Reviewed-by: Chressie Himpel <chressie@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
  • Loading branch information
stapelberg committed Oct 29, 2024
1 parent 0517e5a commit 496557b
Showing 1 changed file with 811 additions and 902 deletions.
Loading

0 comments on commit 496557b

Please sign in to comment.