Skip to content

Commit 2811e86

Browse files
committed
update result verification
1 parent 789349c commit 2811e86

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/connection_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func TestConnectionWithInvalidQuery(t *testing.T) {
7474
return tx.Exec("SELECT * FROM non_existent_table").Error
7575
})
7676
if err == nil {
77-
t.Errorf("Expected error for invalid query in Connection, got nil")
77+
t.Fatalf("Expected error for invalid query in Connection, got nil")
7878
}
7979
}
8080

@@ -107,7 +107,7 @@ func TestConnectionAfterDBClose(t *testing.T) {
107107
return tx.Raw("SELECT 1 FROM dual").Scan(&v).Error
108108
})
109109
if cerr == nil {
110-
t.Errorf("Expected error when calling Connection after DB closed, got nil")
110+
t.Fatalf("Expected error when calling Connection after DB closed, got nil")
111111
}
112112
if DB, err = OpenTestConnection(&gorm.Config{Logger: newLogger}); err != nil {
113113
log.Printf("failed to connect database, got error %v", err)
@@ -118,13 +118,13 @@ func TestConnectionAfterDBClose(t *testing.T) {
118118
func TestConnectionHandlesPanic(t *testing.T) {
119119
defer func() {
120120
if r := recover(); r == nil {
121-
t.Errorf("Expected panic inside Connection, but none occurred")
121+
t.Fatalf("Expected panic inside Connection, but none occurred")
122122
}
123123
}()
124124
DB.Connection(func(tx *gorm.DB) error {
125125
panic("panic in connection callback")
126126
})
127-
t.Errorf("Should have panicked inside connection callback")
127+
t.Fatalf("Should have panicked inside connection callback")
128128
}
129129

130130
func TestConcurrentConnections(t *testing.T) {

0 commit comments

Comments
 (0)