| 19 | ) |
| 20 | |
| 21 | func assertCheckErr(t assert.TestingT, err error, msgAndArgs ...interface{}) bool { |
| 22 | t.(*testing.T).Helper() |
| 23 | if err == nil { |
| 24 | return assert.Fail(t, "Did not receive an error", msgAndArgs...) |
| 25 | } |
| 26 | |
| 27 | if strings.Contains(err.Error(), "keto_uuid_mappings") || // <- normal databases |
| 28 | strings.Contains(err.Error(), "string_representation") || // <- sqlite |
| 29 | strings.Contains(err.Error(), "SQLSTATE 23505") || // <- cockroach |
| 30 | strings.Contains(err.Error(), "SQLSTATE 23514") { // <- mysql |
| 31 | return true |
| 32 | } |
| 33 | return assert.Fail(t, fmt.Sprintf("Did not receive check error, got:\n%+v", err), msgAndArgs...) |
| 34 | } |
| 35 | |
| 36 | func TestUUIDMapping(t *testing.T) { |
| 37 | t.Parallel() |