(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestDeletedAtOneOr(t *testing.T) { |
| 94 | actualSQL := DB.ToSQL(func(tx *gorm.DB) *gorm.DB { |
| 95 | return tx.Or("id = ?", 1).Find(&User{}) |
| 96 | }) |
| 97 | |
| 98 | if !regexp.MustCompile(` WHERE id = 1 AND .users.\..deleted_at. IS NULL`).MatchString(actualSQL) { |
| 99 | t.Fatalf("invalid sql generated, got %v", actualSQL) |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | func TestSoftDeleteZeroValue(t *testing.T) { |
| 104 | type SoftDeleteBook struct { |