add panic log

This commit is contained in:
georgehao 2025-02-04 15:53:52 +08:00
parent be62c3ce27
commit 58989b7ef9
No known key found for this signature in database

View file

@ -32,7 +32,9 @@ func TestClosableMutex_MustLock(t *testing.T) {
cm := NewClosableMutex()
cm.MustLock()
defer func() {
if r := recover(); r == nil {
if r := recover(); r != nil {
t.Log("panic detected:", r) // Log the panic message
} else {
t.Fatal("expected MustLock to panic when already locked")
}
}()