(t *testing.T)
| 324 | } |
| 325 | |
| 326 | func TestEscapeQuotedString(t *testing.T) { |
| 327 | tests := []struct { |
| 328 | input string |
| 329 | quote rune |
| 330 | expected string |
| 331 | }{ |
| 332 | {"hello", '\'', "hello"}, |
| 333 | {"O'Reilly", '\'', "O''Reilly"}, |
| 334 | {`"quoted"`, '"', `""quoted""`}, |
| 335 | {"mixed'\"quotes", '\'', "mixed''\"quotes"}, |
| 336 | {"mixed'\"quotes", '"', "mixed'\"\"quotes"}, |
| 337 | {`escaped\'quote`, '\'', `escaped\'quote`}, |
| 338 | {`escaped\"quote`, '"', `escaped\"quote`}, |
| 339 | } |
| 340 | |
| 341 | for _, tt := range tests { |
| 342 | t.Run(tt.input, func(t *testing.T) { |
| 343 | got := escapeQuotedString(tt.input, tt.quote) |
| 344 | if got != tt.expected { |
| 345 | t.Errorf("escapeQuotedString() with quote %c = %v, want %v", tt.quote, got, tt.expected) |
| 346 | } |
| 347 | }) |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | // Test additional Value.String() cases for byte string literals |
| 352 | func TestValueStringByteStringLiterals(t *testing.T) { |
nothing calls this directly
no test coverage detected