(t *testing.T)
| 279 | } |
| 280 | |
| 281 | func TestEscapeUnicodeString(t *testing.T) { |
| 282 | tests := []struct { |
| 283 | input string |
| 284 | expected string |
| 285 | }{ |
| 286 | {"hello", "hello"}, |
| 287 | {"hello'world", "hello''world"}, |
| 288 | {"hello\\world", "hello\\\\world"}, |
| 289 | {"hello世界", "hello\\4E16\\754C"}, |
| 290 | {"hello\U0001F600", "hello\\+01F600"}, // Emoji (requires >16 bits) |
| 291 | } |
| 292 | |
| 293 | for _, tt := range tests { |
| 294 | t.Run(tt.input, func(t *testing.T) { |
| 295 | got := escapeUnicodeString(tt.input) |
| 296 | if got != tt.expected { |
| 297 | t.Errorf("escapeUnicodeString() = %v, want %v", got, tt.expected) |
| 298 | } |
| 299 | }) |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | func TestEscapeEscapedString(t *testing.T) { |
| 304 | tests := []struct { |
nothing calls this directly
no test coverage detected