lostluck commented on a change in pull request #15112:
URL: https://github.com/apache/beam/pull/15112#discussion_r662542857



##########
File path: sdks/go/pkg/beam/testing/passert/equals_test.go
##########
@@ -130,3 +131,69 @@ func TestEqualsList_Bad(t *testing.T) {
                }
        }
 }
+
+func ExampleEquals() {
+       p, s := beam.NewPipelineWithRoot()
+       col := beam.Create(s, "some", "example", "strings")
+
+       Equals(s, col, "example", "some", "strings")
+       err := ptest.Run(p)
+       fmt.Println(err == nil)
+
+       // Output: true
+}
+
+func ExampleEquals_pcollection() {
+       p, s := beam.NewPipelineWithRoot()
+       col := beam.Create(s, "some", "example", "strings")
+       exp := beam.Create(s, "example", "some", "strings")
+
+       Equals(s, col, exp)
+       err := ptest.Run(p)
+       fmt.Println(err == nil)
+
+       // Output: true
+}
+
+func ExampleEqualsList() {
+       p, s := beam.NewPipelineWithRoot()
+       col := beam.Create(s, "example", "inputs", "here")
+       list := [3]string{"here", "example", "inputs"}
+
+       EqualsList(s, col, list)
+       err := ptest.Run(p)
+       fmt.Println(err == nil)
+
+       // Output: true
+}
+
+func unwrapError(err error) error {
+       if wrapper, ok := err.(interface{ Unwrap() error}); ok {
+               err = wrapper.Unwrap()

Review comment:
       Style wise, idiomatic go tends to just return early as needed, rather 
than trying for a single return. 
   Nothing wrong with the approach, and doesn't make a difference here but good 
to know.
   
   Merging all the same though.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to