itertest

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package itertest defines test functions to verify that `iter.Seq` and `iter.Seq2` implementations properly stop iterating when `yield()` returns false.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifySeq2CanStopAfterN

func VerifySeq2CanStopAfterN[K, V any](t testing.TB, n int, seq iter.Seq2[K, V])

VerifySeq2CanStopAfterN iterates over seq, breaks after n elements, recovers from any panic and reports the error to `t`. A well-behaved iter.Seq2 must not call yield() again after it has returned false.

func VerifySeqCanStopAfterN

func VerifySeqCanStopAfterN[T any](t testing.TB, n int, seq iter.Seq[T])

VerifySeqCanStopAfterN iterates over seq, breaks after n elements, recovers from any panic and reports the error to `t`. A well-behaved iter.Seq must not call yield() again after it has returned false.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL