mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-17 09:56:18 -05:00
27 lines
378 B
Go
27 lines
378 B
Go
package mux_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
. "v2ray.com/core/app/proxyman/mux"
|
|
"v2ray.com/core/testing/assert"
|
|
)
|
|
|
|
func TestSessionManagerAdd(t *testing.T) {
|
|
assert := assert.On(t)
|
|
|
|
m := NewSessionManager()
|
|
|
|
s := m.Allocate()
|
|
assert.Uint16(s.ID).Equals(1)
|
|
|
|
s = m.Allocate()
|
|
assert.Uint16(s.ID).Equals(2)
|
|
|
|
s = &Session{
|
|
ID: 4,
|
|
}
|
|
m.Add(s)
|
|
assert.Uint16(s.ID).Equals(4)
|
|
}
|