- Updated benchmark functions to utilize TaiID instead of pool names for improved consistency and accuracy in tests. - Refactored test cases across various files to ensure compatibility with the new TaiID structure. - Enhanced setup functions to accept pointers to poolConfig for better memory management. - Removed deprecated config struct and adjusted related documentation to reflect the changes in the sandbox architecture. Made-with: Cursor
26 lines
406 B
Go
26 lines
406 B
Go
package sandbox_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
sandbox "github.com/yaoapp/yao/sandbox/v2"
|
|
)
|
|
|
|
func TestInit(t *testing.T) {
|
|
sandbox.Init()
|
|
m := sandbox.M()
|
|
if m == nil {
|
|
t.Fatal("M() returned nil")
|
|
}
|
|
m.Close()
|
|
}
|
|
|
|
func TestMPanicWithoutInit(t *testing.T) {
|
|
sandbox.ResetForTest()
|
|
defer func() {
|
|
if r := recover(); r == nil {
|
|
t.Error("expected panic from M() without Init")
|
|
}
|
|
}()
|
|
sandbox.M()
|
|
}
|