github.com/yandex/pandora@v0.5.32/core/datasink/file_test.go (about) 1 package datasink 2 3 import ( 4 "os" 5 "testing" 6 7 "github.com/spf13/afero" 8 "github.com/yandex/pandora/core/coretest" 9 ) 10 11 func TestFileSink(t *testing.T) { 12 const filename = "/xxx/yyy" 13 fs := afero.NewMemMapFs() 14 sink := NewFile(fs, FileConfig{Path: filename}) 15 coretest.AssertSinkEqualFile(t, fs, filename, sink) 16 } 17 18 func TestStdout(t *testing.T) { 19 coretest.AssertSinkEqualStdStream(t, &os.Stdout, NewStdout) 20 } 21 22 func TestStderr(t *testing.T) { 23 coretest.AssertSinkEqualStdStream(t, &os.Stderr, NewStderr) 24 }