func TestPairErrorsRightTable(t *testing.T) { left := slice.New([]optimus.Row{a, b, c}) right := errorSource.New(fmt.Errorf("garbage error")) table := optimus.Transform(left, Pair(right, KeyIdentifier(""), KeyIdentifier(""), OuterJoin)) tests.Consumed(t, table) tests.Consumed(t, right) assert.EqualError(t, table.Err(), "garbage error") }
func TestJoinErrors(t *testing.T) { left := slice.New([]optimus.Row{a, b, c}) right := errorTable.New(fmt.Errorf("garbage error")) table := optimus.Transform(left, Join(right, "", "", JoinType.Left)) tests.Consumed(t, table) tests.Consumed(t, right) assert.EqualError(t, table.Err(), "garbage error") }
func TestJSONSinkError(t *testing.T) { source := errorSource.New(errors.New("failed")) assert.EqualError(t, New(&bytes.Buffer{})(source), "failed") assert.True(t, source.Stopped) }