Skip to content

Commit 7b9ca38

Browse files
Refactor based on comments
1 parent 17073cb commit 7b9ca38

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

tests/main_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,13 @@ func TestSetAndGet(t *testing.T) {
9292
}
9393
}
9494

95-
func TestInsertScenarios(t *testing.T) {
95+
func TesUserInsertScenarios(t *testing.T) {
9696
type UserWithAge struct {
9797
ID uint `gorm:"column:ID;primaryKey"`
9898
Name string `gorm:"column:NAME"`
9999
Age int `gorm:"column:AGE"`
100100
}
101101

102-
if err := DB.Migrator().DropTable(&UserWithAge{}); err != nil {
103-
t.Fatalf("Failed to drop table: %v", err)
104-
}
105102
if err := DB.AutoMigrate(&UserWithAge{}); err != nil {
106103
t.Fatalf("Failed to migrate table: %v", err)
107104
}
@@ -126,7 +123,7 @@ func TestInsertScenarios(t *testing.T) {
126123
Name string `gorm:"column:NAME"`
127124
CreatedAt time.Time `gorm:"column:CREATED_AT"`
128125
}
129-
126+
130127
if err := DB.AutoMigrate(&UserWithTime{}); err != nil {
131128
t.Fatalf("Failed to migrate UserWithTime table: %v", err)
132129
}

tests/passed-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,4 +379,4 @@ BenchmarkScanSlice
379379
BenchmarkScanSlicePointer
380380
BenchmarkUpdate
381381
BenchmarkDelete
382-
TestInsertScenarios
382+
TesUserInsertScenarios

0 commit comments

Comments
 (0)