mirror of
https://github.com/duke-git/lancet.git
synced 2026-03-01 00:35:28 +08:00
test: add unit test for Promise
This commit is contained in:
@@ -33,9 +33,10 @@ func New[T any](runnable func(resolve func(T), reject func(error))) *Promise[T]
|
||||
}
|
||||
|
||||
p := &Promise[T]{
|
||||
pending: true,
|
||||
mu: &sync.Mutex{},
|
||||
wg: &sync.WaitGroup{},
|
||||
runnable: runnable,
|
||||
pending: true,
|
||||
mu: &sync.Mutex{},
|
||||
wg: &sync.WaitGroup{},
|
||||
}
|
||||
|
||||
defer p.run()
|
||||
|
||||
Reference in New Issue
Block a user