@@ -203,8 +203,8 @@ func TestSet(t *testing.T) {
203203 })
204204}
205205
206- func TestGetCheck (t * testing.T ) {
207- t .Run ("test GetCheck for NewMapKeyValue[string, struct] key exist" , func (t * testing.T ) {
206+ func TestGetAndCheck (t * testing.T ) {
207+ t .Run ("test GetAndCheck for NewMapKeyValue[string, struct] key exist" , func (t * testing.T ) {
208208 type testStruct struct {
209209 Name string
210210 value float64
@@ -217,9 +217,9 @@ func TestGetCheck(t *testing.T) {
217217 t .Errorf ("Expected size to be %v, got %v" , 1 , kv .Size ())
218218 }
219219
220- value , ok := kv .GetCheck ("Archimedes" )
220+ value , ok := kv .GetAndCheck ("Archimedes" )
221221 if ! ok {
222- t .Errorf ("Expected GetCheck to return true, got %v" , ok )
222+ t .Errorf ("Expected GetAndCheck to return true, got %v" , ok )
223223 }
224224
225225 if value .Name != "This is Archimedes' Constant (Pi)" {
@@ -230,7 +230,7 @@ func TestGetCheck(t *testing.T) {
230230 }
231231 })
232232
233- t .Run ("test GetCheck for NewMapKeyValue[string, struct] key doesn't exist" , func (t * testing.T ) {
233+ t .Run ("test GetAndCheck for NewMapKeyValue[string, struct] key doesn't exist" , func (t * testing.T ) {
234234 type testStruct struct {
235235 Name string
236236 value float64
@@ -243,9 +243,9 @@ func TestGetCheck(t *testing.T) {
243243 t .Errorf ("Expected size to be %v, got %v" , 1 , kv .Size ())
244244 }
245245
246- _ , ok := kv .GetCheck ("Euler" )
246+ _ , ok := kv .GetAndCheck ("Euler" )
247247 if ok {
248- t .Errorf ("Expected GetCheck to return true, got %v" , ok )
248+ t .Errorf ("Expected GetAndCheck to return true, got %v" , ok )
249249 }
250250 })
251251}
0 commit comments