diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2022-05-28 19:24:48 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2022-05-28 19:49:42 -0400 |
| commit | cec23e66f9bd5022845162ae4dd3f2633b5236fa (patch) | |
| tree | f5caf83d0c92ce80942b2e7ed5e184ffb69e3c2d /data/datasource_stdin_test.go | |
| parent | e00015a86393e947757dea88cb82b328b35ad8b4 (diff) | |
General refactoring & cleanup
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'data/datasource_stdin_test.go')
| -rw-r--r-- | data/datasource_stdin_test.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/data/datasource_stdin_test.go b/data/datasource_stdin_test.go index 1b92914e..6cd34133 100644 --- a/data/datasource_stdin_test.go +++ b/data/datasource_stdin_test.go @@ -11,15 +11,12 @@ import ( func TestReadStdin(t *testing.T) { ctx := context.Background() - defer func() { - stdin = nil - }() - stdin = strings.NewReader("foo") + ctx = ContextWithStdin(ctx, strings.NewReader("foo")) out, err := readStdin(ctx, nil) assert.NoError(t, err) assert.Equal(t, []byte("foo"), out) - stdin = errorReader{} + ctx = ContextWithStdin(ctx, errorReader{}) _, err = readStdin(ctx, nil) assert.Error(t, err) } |
