Files
EdgeNode/internal/utils/goman/lib_test.go

31 lines
502 B
Go
Raw Normal View History

2024-05-17 18:30:33 +08:00
// Copyright 2021 GoEdge goedge.cdn@gmail.com. All rights reserved.
package goman_test
import (
"testing"
"time"
2024-07-27 15:42:50 +08:00
"github.com/TeaOSLab/EdgeNode/internal/utils/goman"
)
func TestNew(t *testing.T) {
goman.New(func() {
t.Log("Hello")
t.Log(goman.List())
})
time.Sleep(1 * time.Second)
t.Log(goman.List())
time.Sleep(1 * time.Second)
}
2021-12-14 10:49:40 +08:00
func TestNewWithArgs(t *testing.T) {
goman.NewWithArgs(func(args ...interface{}) {
2021-12-14 10:49:40 +08:00
t.Log(args[0], args[1])
}, 1, 2)
time.Sleep(1 * time.Second)
}