(t *testing.T)
| 496 | } |
| 497 | |
| 498 | func TestFormatErrorWithUnicode(t *testing.T) { |
| 499 | tests := []struct { |
| 500 | name string |
| 501 | sql string |
| 502 | location models.Location |
| 503 | contains []string |
| 504 | }{ |
| 505 | { |
| 506 | name: "Chinese SQL", |
| 507 | sql: "SELECT * FROM 用户表 WHERE 姓名 = '张三'", |
| 508 | location: models.Location{Line: 1, Column: 15}, |
| 509 | contains: []string{ |
| 510 | "用户表", |
| 511 | "^", |
| 512 | }, |
| 513 | }, |
| 514 | { |
| 515 | name: "Japanese SQL", |
| 516 | sql: "SELECT * FROM テーブル WHERE 名前 = '太郎'", |
| 517 | location: models.Location{Line: 1, Column: 15}, |
| 518 | contains: []string{ |
| 519 | "テーブル", |
| 520 | "^", |
| 521 | }, |
| 522 | }, |
| 523 | { |
| 524 | name: "Arabic SQL", |
| 525 | sql: "SELECT * FROM جدول WHERE اسم = 'أحمد'", |
| 526 | location: models.Location{Line: 1, Column: 15}, |
| 527 | contains: []string{ |
| 528 | "جدول", |
| 529 | "^", |
| 530 | }, |
| 531 | }, |
| 532 | { |
| 533 | name: "Emoji in SQL", |
| 534 | sql: "SELECT * FROM users WHERE status = '✅'", |
| 535 | location: models.Location{Line: 1, Column: 37}, |
| 536 | contains: []string{ |
| 537 | "✅", |
| 538 | "^", |
| 539 | }, |
| 540 | }, |
| 541 | { |
| 542 | name: "Multi-line Unicode", |
| 543 | sql: `SELECT * |
| 544 | FROM 用户表 |
| 545 | WHERE 年龄 > 18`, |
| 546 | location: models.Location{Line: 2, Column: 6}, |
| 547 | contains: []string{ |
| 548 | "用户表", |
| 549 | "^", |
| 550 | }, |
| 551 | }, |
| 552 | } |
| 553 | |
| 554 | for _, tt := range tests { |
| 555 | t.Run(tt.name, func(t *testing.T) { |
nothing calls this directly
no test coverage detected