Skip to content

Commit 93e5577

Browse files
JohonsoyJames Cor
authored andcommitted
revert: revert delete test code
1 parent 374904e commit 93e5577

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

_example/main_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func TestExampleRootUserEnabled(t *testing.T) {
6565
}()
6666
conn, err := dbr.Open("mysql", fmt.Sprintf("no_user:@tcp(%s:%d)/%s", address, port, dbName), nil)
6767
require.NoError(t, err)
68+
require.ErrorContains(t, conn.Ping(), "User not found")
6869
conn, err = dbr.Open("mysql", fmt.Sprintf("root:@tcp(%s:%d)/%s", address, port, dbName), nil)
6970
require.NoError(t, err)
7071
require.NoError(t, conn.Ping())
@@ -85,8 +86,10 @@ func TestExampleLoadedUser(t *testing.T) {
8586
}()
8687
conn, err := dbr.Open("mysql", fmt.Sprintf("no_user:@tcp(%s:%d)/%s", address, port, dbName), nil)
8788
require.NoError(t, err)
89+
require.ErrorContains(t, conn.Ping(), "User not found")
8890
conn, err = dbr.Open("mysql", fmt.Sprintf("root:@tcp(%s:%d)/%s", address, port, dbName), nil)
8991
require.NoError(t, err)
92+
require.ErrorContains(t, conn.Ping(), "User not found")
9093
conn, err = dbr.Open("mysql",
9194
fmt.Sprintf("gms_user:123456@tcp(%s:%d)/%s?allowCleartextPasswords=true", address, port, dbName), nil)
9295
require.NoError(t, err)

0 commit comments

Comments
 (0)