improve utils code coverage (#1473)
This commit is contained in:
		@ -5,6 +5,8 @@
 | 
				
			|||||||
package gin
 | 
					package gin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"bytes"
 | 
				
			||||||
 | 
						"encoding/xml"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
@ -124,3 +126,14 @@ func TestBindMiddleware(t *testing.T) {
 | 
				
			|||||||
		Bind(&bindTestStruct{})
 | 
							Bind(&bindTestStruct{})
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestMarshalXMLforH(t *testing.T) {
 | 
				
			||||||
 | 
						h := H{
 | 
				
			||||||
 | 
							"": "test",
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						var b bytes.Buffer
 | 
				
			||||||
 | 
						enc := xml.NewEncoder(&b)
 | 
				
			||||||
 | 
						var x xml.StartElement
 | 
				
			||||||
 | 
						e := h.MarshalXML(enc, x)
 | 
				
			||||||
 | 
						assert.Error(t, e)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user