30 lines
413 B
Go
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)
|
|
}
|
|
}
|
|
}
|