github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/map_/iter/test/iter_test.go (about)

     1  package test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/m4gshm/gollections/map_"
     7  	"github.com/stretchr/testify/assert"
     8  )
     9  
    10  func Test_Key_Zero_Safety(t *testing.T) {
    11  	var it map_.KeyIter[int, string]
    12  
    13  	_, ok := it.Next()
    14  	assert.False(t, ok)
    15  	assert.Equal(t, 0, it.Size())
    16  
    17  }
    18  
    19  func Test_OrderedMapIter_Safety(t *testing.T) {
    20  	var it map_.Iter[int, string]
    21  
    22  	_, _, ok := it.Next()
    23  	assert.False(t, ok)
    24  	assert.Equal(t, 0, it.Size())
    25  }