(t *testing.T)
| 27 | } |
| 28 | |
| 29 | func TestMigrateError(t *testing.T) { |
| 30 | err := &MigrateError{ |
| 31 | Message: "chat migrated", |
| 32 | MigrateToChatID: 12345, |
| 33 | } |
| 34 | |
| 35 | expectedErrorMsg := "chat migrated: migrate_to_chat_id 12345" |
| 36 | if err.Error() != expectedErrorMsg { |
| 37 | t.Errorf("expected %s, got %s", expectedErrorMsg, err.Error()) |
| 38 | } |
| 39 | |
| 40 | if !IsMigrateError(err) { |
| 41 | t.Errorf("expected IsMigrateError to return true") |
| 42 | } |
| 43 | |
| 44 | var genericError error = err |
| 45 | if !IsMigrateError(genericError) { |
| 46 | t.Errorf("expected IsMigrateError to return true for generic error type") |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func TestStandardErrors(t *testing.T) { |
| 51 | tests := []struct { |
nothing calls this directly
no test coverage detected