ZhengLin-Li commented on code in PR #24811:
URL: https://github.com/apache/beam/pull/24811#discussion_r1059226002


##########
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.")
+               }
+       }
+}
+
+func TestInput(t *testing.T) {
+       name1 := "this is a string"
+       collection1 := beam.PCollection{}
+       tests := []struct {
+               name string
+               in   beam.PCollection
+       }{
+               {
+                       name: name1,
+                       in:   collection1,
+               },
+       }
+
+       o := &options{inputs: make(map[string]beam.PCollection)}
+       for _, test := range tests {
+               option := Input(test.name, test.in)
+               if option == nil {
+                       t.Errorf("%v return a nil value, which is not 
expected", runtime.FuncForPC(reflect.ValueOf(TestInput).Pointer()).Name())

Review Comment:
   Got it, I will simply use the text directly, followed by 
[https://google.github.io/styleguide/go/decisions#identify-the-function](https://google.github.io/styleguide/go/decisions#identify-the-function)



-- 
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