File: iterator_test.go

package info (click to toggle)
golang-github-anacrolix-missinggo 2.1.0-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 872 kB
  • sloc: makefile: 4
file content (17 lines) | stat: -rw-r--r-- 292 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package iter

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestIterator(t *testing.T) {
	const s = "AAAABBBCCDAABBB"
	si := StringIterator(s)
	for i := range s {
		require.True(t, si.Next())
		require.Equal(t, s[i], si.Value().(byte))
	}
	require.False(t, si.Next())
}