fixed v4 chages #124
							
								
								
									
										10
									
								
								util_test.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								util_test.go
									
									
									
									
									
								
							@@ -61,9 +61,16 @@ func TestNewPathRequest(t *testing.T) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func TestNewPathRequestWithEmptyBody(t *testing.T) {
 | 
					func TestNewPathRequestWithEmptyBody(t *testing.T) {
 | 
				
			||||||
	val := struct{}{}
 | 
						val := struct{}{}
 | 
				
			||||||
 | 
						cases := []string{
 | 
				
			||||||
 | 
							"",
 | 
				
			||||||
 | 
							"*",
 | 
				
			||||||
 | 
							"{}",
 | 
				
			||||||
 | 
							"nil",
 | 
				
			||||||
 | 
							`{"type": "invalid"}`,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for _, body := range cases {
 | 
				
			||||||
		for _, m := range []string{"POST", "PUT", "PATCH", "GET", "DELETE"} {
 | 
							for _, m := range []string{"POST", "PUT", "PATCH", "GET", "DELETE"} {
 | 
				
			||||||
		body := `{"type": "invalid"}`
 | 
					 | 
				
			||||||
			path, nmsg, err := newPathRequest("/v1/test", m, body, val, []string{"protobuf", "json"}, nil)
 | 
								path, nmsg, err := newPathRequest("/v1/test", m, body, val, []string{"protobuf", "json"}, nil)
 | 
				
			||||||
			if err != nil {
 | 
								if err != nil {
 | 
				
			||||||
				t.Fatal(err)
 | 
									t.Fatal(err)
 | 
				
			||||||
@@ -81,6 +88,7 @@ func TestNewPathRequestWithEmptyBody(t *testing.T) {
 | 
				
			|||||||
				t.Fatalf("invalid path: %v nmsg: %v", path, nmsg)
 | 
									t.Fatalf("invalid path: %v nmsg: %v", path, nmsg)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestNewPathVarRequest(t *testing.T) {
 | 
					func TestNewPathVarRequest(t *testing.T) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user