(t *testing.T)
| 17 | ) |
| 18 | |
| 19 | func TestErrorSQLState(t *testing.T) { |
| 20 | r := readBuf([]byte{67, 52, 48, 48, 48, 49, 0, 0}) // 40001 |
| 21 | err := parseError(&r, "") |
| 22 | var sqlErr interface{ SQLState() string } |
| 23 | if !errors.As(err, &sqlErr) { |
| 24 | t.Fatal("SQLState interface not satisfied") |
| 25 | } |
| 26 | if state := err.SQLState(); state != "40001" { |
| 27 | t.Fatalf("unexpected SQL state %v", state) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | func TestErrorClass(t *testing.T) { |
| 32 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…