ZhengLin-Li commented on code in PR #24811:
URL: https://github.com/apache/beam/pull/24811#discussion_r1059225224
##########
sdks/go/pkg/beam/transforms/sql/sql_test.go:
##########
@@ -0,0 +1,105 @@
+package sql
+
+import (
+ "github.com/apache/beam/sdks/v2/go/pkg/beam"
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/transforms/sql/sqlx"
+ "reflect"
+ "runtime"
+ "testing"
+)
+
+func TestOptions_Add(t *testing.T) {
+ o := options{}
+ str := "this is a string"
+ bytes := []byte{1, 2, 3, 4}
+ testOpt := sqlx.Option{
+ Urn: str,
+ Payload: bytes,
+ }
+ tests := []struct {
+ opt sqlx.Option
+ }{
+ {
+ opt: testOpt,
+ },
+ }
+
+ for _, test := range tests {
+ o.Add(test.opt)
+ if o.customs == nil ||
!reflect.DeepEqual(o.customs[len(o.customs)-1], test.opt) {
+ t.Errorf("Add failed.")
Review Comment:
In my last commit, I changed it to
```go
t.Errorf("The method options.Add(%v) did not successfully perform the add
operation", test.opt)
```
I attempted to use the form `YourFunc(%v) = %v, want %v` but found out that
the method I'm testing does not have a return value.
--
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]