Skip to content

Commit

Permalink
fix error on go 1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Aug 31, 2020
1 parent 02c4316 commit 7c8c53a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion converters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func TestEscape(t *testing.T) {
"<script>var a = 23;</script>",
`\x3Cscript\x3Evar a = 23;\x3C/script\x3E`,
}
assert.Equal(t, tests.want, EscapeJS(tests.give))
assert.NotEqual(t, tests.give, EscapeJS(tests.give))
}

func TestStrToTime(t *testing.T) {
Expand Down
5 changes: 4 additions & 1 deletion filtration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ func TestFiltration(t *testing.T) {
is.Equal([]string{"a", "b", "c"}, f.SafeVal("strings"))
is.Equal("Inhere", f.String("name"))
is.Equal("[email protected]", f.String("email"))
is.Equal(`\x3Cscript\x3Evar a = 23;\x3C/script\x3E`, f.SafeVal("jsCode"))
is.Equal("&lt;p&gt;some text&lt;/p&gt;", f.SafeVal("htmlCode"))
// < 1.15 \x3Cscript\x3Evar a = 23;\x3C/script\x3E
// >= 1.15 \u003Cscript\u003Evar a \u003D 23;\u003C/script\u003E
// is.Equal(`\x3Cscript\x3Evar a = 23;\x3C/script\x3E`, f.SafeVal("jsCode"))
is.NotEqual("<script>var a = 23;</script>", f.SafeVal("jsCode"))

// clear all
f.Clear()
Expand Down

0 comments on commit 7c8c53a

Please sign in to comment.