We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12aec55 commit 4ad1355Copy full SHA for 4ad1355
src/html/fuzz.go
@@ -0,0 +1,31 @@
1
+// Copyright 2019 The Go Authors. All rights reserved.
2
+// Use of this source code is governed by a BSD-style
3
+// license that can be found in the LICENSE file.
4
+
5
+// +build gofuzz
6
7
+package html
8
9
+import (
10
+ "fmt"
11
+)
12
13
+func Fuzz(data []byte) int {
14
+ v := string(data)
15
16
+ e := EscapeString(v)
17
+ u := UnescapeString(e)
18
+ if v != u {
19
+ fmt.Printf("v = %q\n", v)
20
+ fmt.Printf("e = %q\n", e)
21
+ fmt.Printf("u = %q\n", u)
22
+ panic("not equal")
23
+ }
24
25
+ // As per the documentation, this isn't always equal to v, so it makes
26
+ // no sense to check for equality. It can still be interesting to find
27
+ // panics in it though.
28
+ EscapeString(UnescapeString(v))
29
30
+ return 0
31
+}
0 commit comments