1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 13:40:55 +00:00

Add two test cases for ParseForm

This commit is contained in:
miraclesu 2013-07-25 22:50:29 +08:00
parent b8e06f6365
commit b99a09d73b

View File

@ -27,6 +27,12 @@ func TestParseForm(t *testing.T) {
if err := ParseForm(form, &u); err != nil { if err := ParseForm(form, &u); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if u.Id != 0 {
t.Error("Id should not be changed")
}
if len(u.tag) != 0 {
t.Error("tag should not be changed")
}
if u.Name.(string) != "test" { if u.Name.(string) != "test" {
t.Error("should be equal") t.Error("should be equal")
} }