Explorar el Código

add more tests

kevin hace 4 años
padre
commit
b8fcdd5460
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      rest/httpx/requests_test.go

+ 7 - 0
rest/httpx/requests_test.go

@@ -27,6 +27,13 @@ func TestParseForm(t *testing.T) {
 	assert.Equal(t, 3.4, v.Percent)
 }
 
+func TestParseHeader(t *testing.T) {
+	m := ParseHeader("key=value;")
+	assert.EqualValues(t, map[string]string{
+		"key": "value",
+	}, m)
+}
+
 func TestParseFormOutOfRange(t *testing.T) {
 	var v struct {
 		Age int `form:"age,range=[10:20)"`