示例#1
0
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")
}
示例#2
0
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")
}
示例#3
0
func TestJSONSinkError(t *testing.T) {
	source := errorSource.New(errors.New("failed"))
	assert.EqualError(t, New(&bytes.Buffer{})(source), "failed")
	assert.True(t, source.Stopped)
}