1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-30 19:15:23 +00:00
v2fly/app/proxyman/mux/session_test.go

29 lines
404 B
Go
Raw Normal View History

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 := &Session{}
m.Allocate(s)
assert.Uint16(s.ID).Equals(1)
s = &Session{}
m.Allocate(s)
assert.Uint16(s.ID).Equals(2)
s = &Session{
ID: 4,
}
m.Add(s)
assert.Uint16(s.ID).Equals(4)
}