mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 06:13:42 +00:00
包名重构
This commit is contained in:
1 parent
fb45066228
commit
8298051c81
37 files changed
+220
-134
No files matched your search
@@ -0,0 +1,40 @@
|
||||
package torrent
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/monkeyWie/gopeed/protocol/bt/peer"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_PeerPool(t *testing.T) {
|
||||
pool := newPeerPool()
|
||||
pool.put([]peer.Peer{
|
||||
{
|
||||
IP: 0,
|
||||
Port: 0,
|
||||
},
|
||||
{
|
||||
IP: 1,
|
||||
Port: 0,
|
||||
},
|
||||
{
|
||||
IP: 2,
|
||||
Port: 0,
|
||||
},
|
||||
{
|
||||
IP: 3,
|
||||
Port: 0,
|
||||
},
|
||||
{
|
||||
IP: 4,
|
||||
Port: 0,
|
||||
},
|
||||
})
|
||||
get := pool.get()
|
||||
pool.release(get)
|
||||
pool.remove(get)
|
||||
for i := 0; i < 5; i++ {
|
||||
fmt.Println(pool.get())
|
||||
}
|
||||
fmt.Println(pool.get())
|
||||
}
|
||||
Reference in new issue
Block a user