From d46e8a6f92d612a9e3712dbec1256eba5c0f7e29 Mon Sep 17 00:00:00 2001 From: xiezhaodong Date: Mon, 14 Apr 2025 14:35:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81lru=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/prepared_stmt_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/prepared_stmt_test.go b/tests/prepared_stmt_test.go index 20a4f730..6e8a0745 100644 --- a/tests/prepared_stmt_test.go +++ b/tests/prepared_stmt_test.go @@ -117,8 +117,8 @@ func TestPreparedStmtDeadlock(t *testing.T) { conn, ok := tx.ConnPool.(*gorm.PreparedStmtDB) AssertEqual(t, ok, true) - AssertEqual(t, len(conn.Stmts), 2) - for _, stmt := range conn.Stmts { + AssertEqual(t, len(conn.Stmts.AllMap()), 2) + for _, stmt := range conn.Stmts.AllMap() { if stmt == nil { t.Fatalf("stmt cannot bee nil") } @@ -155,7 +155,7 @@ func TestPreparedStmtReset(t *testing.T) { } pdb.Mux.Lock() - if len(pdb.Stmts) == 0 { + if len(pdb.Stmts.AllMap()) == 0 { pdb.Mux.Unlock() t.Fatalf("prepared stmt can not be empty") } @@ -164,7 +164,7 @@ func TestPreparedStmtReset(t *testing.T) { pdb.Reset() pdb.Mux.Lock() defer pdb.Mux.Unlock() - if len(pdb.Stmts) != 0 { + if len(pdb.Stmts.AllMap()) != 0 { t.Fatalf("prepared stmt should be empty") } }