示例#1
0
func TestFirstOnlyEmpty(t *testing.T) {
	stream := functional.NilStream()
	var value int
	if output := FirstOnly(stream, emptyError, &value); output != emptyError {
		t.Errorf("Expected emptyError, got %v", output)
	}
}
示例#2
0
func TestPageBufferEmptyLow(t *testing.T) {
	stream := &closeChecker{
		Stream: functional.NilStream()}
	pb := NewPageBuffer(make([]int, 6), -1)
	pb.Consume(stream)
	verifyPageFetched(t, pb, 0, 0, 0, true)
}