You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/12/30 03:05:31 UTC
[GitHub] [beam] ZhengLin-Li commented on a diff in pull request #24811: [#21384] Add unit tests to the sql package
ZhengLin-Li commented on code in PR #24811:
URL: https://github.com/apache/beam/pull/24811#discussion_r1059224041
##########
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,
Review Comment:
Thanks for reviewing my PR; I have changed my code.
The reason I originally used the tests slice is that it may support more extensibility if we later add more test cases. But since just one test case can successfully test the function, there is no need for more test cases, I think.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org