Skip to content

Commit 261886e

Browse files
committed
Fix Test with alias.
1 parent 92f04ca commit 261886e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

tests/generics_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,14 @@ func TestGenericsCreateInBatches(t *testing.T) {
151151
}
152152

153153
func TestGenericsExecAndUpdate(t *testing.T) {
154-
t.Skip()
155154
ctx := context.Background()
156155

157156
name := "GenericsExec"
158157
if err := gorm.G[User](DB).Exec(ctx, "INSERT INTO \"users\"(\"name\") VALUES(?)", name); err != nil {
159158
t.Fatalf("Exec insert failed: %v", err)
160159
}
161160

162-
u, err := gorm.G[User](DB).Table("\"users\" u").Where("u.name = ?", name).First(ctx)
161+
u, err := gorm.G[User](DB).Table("\"users\" \"u\"").Where("\"u\".\"name\" = ?", name).First(ctx)
163162
if err != nil {
164163
t.Fatalf("failed to find user, got error: %v", err)
165164
} else if u.Name != name || u.ID == 0 {

tests/passed-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ TestSupportedDialectorWithErrDuplicatedKey
114114
TestSupportedDialectorWithErrForeignKeyViolated
115115
#TestGenericsCreate
116116
TestGenericsCreateInBatches
117-
#TestGenericsExecAndUpdate
117+
TestGenericsExecAndUpdate
118118
TestGenericsRow
119119
TestGenericsDelete
120120
TestGenericsFindInBatches

0 commit comments

Comments
 (0)