1
0
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:
dudaodong
2023-03-16 16:55:32 +08:00
parent 930bb9c839
commit 73ac9825e9
2 changed files with 150 additions and 3 deletions

View File

@@ -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()