Add two test cases for ParseForm
Showing
1 changed file
with
6 additions
and
0 deletions
| ... | @@ -27,6 +27,12 @@ func TestParseForm(t *testing.T) { | ... | @@ -27,6 +27,12 @@ func TestParseForm(t *testing.T) { |
| 27 | if err := ParseForm(form, &u); err != nil { | 27 | if err := ParseForm(form, &u); err != nil { |
| 28 | t.Fatal(err) | 28 | t.Fatal(err) |
| 29 | } | 29 | } |
| 30 | if u.Id != 0 { | ||
| 31 | t.Error("Id should not be changed") | ||
| 32 | } | ||
| 33 | if len(u.tag) != 0 { | ||
| 34 | t.Error("tag should not be changed") | ||
| 35 | } | ||
| 30 | if u.Name.(string) != "test" { | 36 | if u.Name.(string) != "test" { |
| 31 | t.Error("should be equal") | 37 | t.Error("should be equal") |
| 32 | } | 38 | } | ... | ... |
-
Please register or sign in to post a comment