// expectedIRIs is with respect to the query's page settings.
// Since Iterator.TotalItems' count is not affected by page settings, expectedTotalItems must be passed in explicitly.
// It can't be determined by looking at the length of expectedIRIs.
expectedIRIs is with respect to the query's page settings.
Since Iterator.TotalItems' count is not affected by page settings, expectedTotalItems must be passed in explicitly.
It can't be determined by looking at the length of expectedIRIs.
// expectedIRIs is with respect to the query ' s page settings . // Since Iterator . TotalItems ' count is not affected by page settings expectedTotalItems must be passed in explicitly . // It can ' t be determined by looking at the length of expectedIRIs .
func checkReferenceQueryResultsInOrder(t *testing.T, it spi.ReferenceIterator, expectedTotalItems int,
	expectedIRIs ...*url.URL) {
	t.Helper()
	require.NotNil(t, it)
	for i := 0; i < len(expectedIRIs); i++ {
		iri, err := it.Next()
		require.NoError(t, err)
		require.NotNil(t, iri)
		require.Equal(t, expectedIRIs[i].String(), iri.String())
	}
	totalItems, err := it.TotalItems()
	require.NoError(t, err)
	require.Equal(t, expectedTotalItems, totalItems)
	iri, err := it.Next()
	require.Error(t, err)
	require.True(t, errors.Is(err, spi.ErrNotFound))
	require.Nil(t, iri)
	require.NoError(t, it.Close())
}
func checkReferenceQueryResultsInOrder ( t * testing . T , it spi . ReferenceIterator , expectedTotalItems int , expectedIRIs ... * url . URL ) { t . Helper ( ) require . NotNil ( t , it ) for i := 0 ; i < len ( expectedIRIs ) ; i ++ { iri , err := it . Next ( ) require . NoError ( t , err ) require . NotNil ( t , iri ) require . Equal ( t , expectedIRIs [ i ] . String ( ) , iri . String ( ) ) } totalItems , err := it . TotalItems ( ) require . NoError ( t , err ) require . Equal ( t , expectedTotalItems , totalItems ) iri , err := it . Next ( ) require . Error ( t , err ) require . True ( t , errors . Is ( err , spi . ErrNotFound ) ) require . Nil ( t , iri ) require . NoError ( t , it . Close ( ) ) }
expectedIRIs is with respect to the query's page settings.
expectedIRIs is with respect to the query ' s page settings .