|
@@ -262,6 +262,14 @@ func TestEscapeBackslash(t *testing.T) {
|
|
|
expected, actual,
|
|
expected, actual,
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ actual = string(escapeStringBackslash([]byte{}, value))
|
|
|
|
|
+ if actual != expected {
|
|
|
|
|
+ t.Errorf(
|
|
|
|
|
+ "expected %s, got %s",
|
|
|
|
|
+ expected, actual,
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
expect("foo\\0bar", "foo\x00bar")
|
|
expect("foo\\0bar", "foo\x00bar")
|
|
@@ -282,6 +290,14 @@ func TestEscapeQuotes(t *testing.T) {
|
|
|
expected, actual,
|
|
expected, actual,
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ actual = string(escapeStringQuotes([]byte{}, value))
|
|
|
|
|
+ if actual != expected {
|
|
|
|
|
+ t.Errorf(
|
|
|
|
|
+ "expected %s, got %s",
|
|
|
|
|
+ expected, actual,
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
expect("foo\x00bar", "foo\x00bar") // not affected
|
|
expect("foo\x00bar", "foo\x00bar") // not affected
|