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) } }
// OnDate returns a new R instance that represents happening once on a // particular date and time. func OnDate(targetTime time.Time) R { return RFunc(func(t time.Time) functional.Stream { if targetTime.After(t) { return functional.NewStreamFromValues([]time.Time{targetTime}, nil) } return functional.NilStream() }) }
func (n nilRecurring) ForTime(t time.Time) functional.Stream { return functional.NilStream() }
func TestPageBufferEmptyLow(t *testing.T) { stream := functional.NilStream() pb := NewPageBuffer(make([]int, 6), -1) doConsume(t, pb, stream, nil) verifyPageFetched(t, pb, 0, 0, 0, true) }