Verifies: SYS-REQ-014 (escape handling) reqproof:proptest:skip targeted witness/regression test; not a property-test subject
(t *testing.T)
| 414 | // Verifies: SYS-REQ-014 (escape handling) |
| 415 | // reqproof:proptest:skip targeted witness/regression test; not a property-test subject |
| 416 | func 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 |