Skip to content

Commit 0c7ae46

Browse files
committed
test for escapeString*
1 parent 43536c7 commit 0c7ae46

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

utils_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ func TestEscapeBackslash(t *testing.T) {
262262
expected, actual,
263263
)
264264
}
265+
266+
actual = string(escapeStringBackslash([]byte{}, value))
267+
if actual != expected {
268+
t.Errorf(
269+
"expected %s, got %s",
270+
expected, actual,
271+
)
272+
}
265273
}
266274

267275
expect("foo\\0bar", "foo\x00bar")
@@ -282,6 +290,14 @@ func TestEscapeQuotes(t *testing.T) {
282290
expected, actual,
283291
)
284292
}
293+
294+
actual = string(escapeStringQuotes([]byte{}, value))
295+
if actual != expected {
296+
t.Errorf(
297+
"expected %s, got %s",
298+
expected, actual,
299+
)
300+
}
285301
}
286302

287303
expect("foo\x00bar", "foo\x00bar") // not affected

0 commit comments

Comments
 (0)