utils/maps_test.go
2023-10-02 23:42:16 +02:00

30 lines
413 B
Go

package utils
import (
"testing"
)
func TestGetAllStringKeysOfMap(t *testing.T) {
got := GetAllStringKeysOfMap(
map[string]string{
"this": "is",
"a": "very",
"easy": "test",
"for": "me",
},
)
want := []string{
"a",
"easy",
"for",
"this",
}
for i := 0; i <= 3; i++ {
if got[i] != want[i] {
t.Errorf("\ngot: %s\nwanted: %s\nfor: %+v", got[i], want[i], got)
}
}
}