damccorm commented on a change in pull request #16937:
URL: https://github.com/apache/beam/pull/16937#discussion_r815360315



##########
File path: sdks/go/pkg/beam/io/textio/textio_test.go
##########
@@ -40,3 +46,68 @@ func TestRead(t *testing.T) {
        }
 
 }
+
+func TestRead(t *testing.T) {
+       p, s := beam.NewPipelineWithRoot()
+       lines := Read(s, testFilePath)
+       passert.Count(s, lines, "NumLines", 1)
+
+       if _, err := beam.Run(context.Background(), "direct", p); err != nil {

Review comment:
       Done! Good call

##########
File path: sdks/go/pkg/beam/io/textio/textio_test.go
##########
@@ -40,3 +46,68 @@ func TestRead(t *testing.T) {
        }
 
 }
+
+func TestRead(t *testing.T) {
+       p, s := beam.NewPipelineWithRoot()
+       lines := Read(s, testFilePath)
+       passert.Count(s, lines, "NumLines", 1)
+
+       if _, err := beam.Run(context.Background(), "direct", p); err != nil {
+               t.Fatalf("Failed to execute job: %v", err)
+       }
+}
+
+func TestReadAll(t *testing.T) {
+       p, s := beam.NewPipelineWithRoot()
+       files := beam.Create(s, testFilePath)
+       lines := ReadAll(s, files)
+       passert.Count(s, lines, "NumLines", 1)
+
+       if _, err := beam.Run(context.Background(), "direct", p); err != nil {
+               t.Fatalf("Failed to execute job: %v", err)
+       }
+}
+
+func TestWrite(t *testing.T) {
+       out := "text.txt"
+       p, s := beam.NewPipelineWithRoot()
+       lines := Read(s, testFilePath)
+       Write(s, out, lines)
+
+       if _, err := beam.Run(context.Background(), "direct", p); err != nil {
+               t.Fatalf("Failed to execute job: %v", err)
+       }
+
+       if _, err := os.Stat(out); errors.Is(err, os.ErrNotExist) {
+               t.Fatalf("Failed to write %v", out)
+       }
+       defer os.Remove(out)

Review comment:
       Updated!




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