2023-10-16 22:16:20 +00:00
|
|
|
package server
|
2023-07-10 19:02:44 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2024-02-15 05:46:47 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v5/testing/assert"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/testing/require"
|
2023-07-10 19:02:44 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestNormalizeQueryValues(t *testing.T) {
|
|
|
|
input := make(map[string][]string)
|
|
|
|
input["key"] = []string{"value1", "value2,value3,value4", "value5"}
|
|
|
|
|
|
|
|
NormalizeQueryValues(input)
|
|
|
|
require.Equal(t, 5, len(input["key"]))
|
|
|
|
assert.Equal(t, "value1", input["key"][0])
|
|
|
|
assert.Equal(t, "value2", input["key"][1])
|
|
|
|
assert.Equal(t, "value3", input["key"][2])
|
|
|
|
assert.Equal(t, "value4", input["key"][3])
|
|
|
|
assert.Equal(t, "value5", input["key"][4])
|
|
|
|
}
|