MCPcopy Create free account
hub / github.com/buger/jsonparser / TestEscapeUnicode

Function TestEscapeUnicode

escape_test.go:416–430  ·  view source on GitHub ↗

Verifies: SYS-REQ-014 (escape handling) reqproof:proptest:skip targeted witness/regression test; not a property-test subject

(t *testing.T)

Source from the content-addressed store, hash-verified

414// Verifies: SYS-REQ-014 (escape handling)
415// reqproof:proptest:skip targeted witness/regression test; not a property-test subject
416func TestEscapeUnicode(t *testing.T) {
417 in := "你好,世界 🌍"
418 escaped := Escape(in)
419 if want := `"` + in + `"`; string(escaped) != want {
420 t.Fatalf("Escape(%q) = %q; want %q", in, escaped, want)
421 }
422
423 unescaped, err := Unescape(escaped[1:len(escaped)-1], nil)
424 if err != nil {
425 t.Fatalf("Unescape(Escape(%q)) returned error: %v", in, err)
426 }
427 if got := string(unescaped); got != in {
428 t.Fatalf("Unescape(Escape(%q)) = %q; want %q", in, got, in)
429 }
430}
431
432// Verifies: SYS-REQ-014 (escape handling)
433// reqproof:proptest:skip targeted witness/regression test; not a property-test subject

Callers

nothing calls this directly

Calls 2

EscapeFunction · 0.85
UnescapeFunction · 0.85

Tested by

no test coverage detected