mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-16 09:26:21 -05:00
35 lines
870 B
Go
35 lines
870 B
Go
package protocol_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
. "v2ray.com/core/common/protocol"
|
|
"v2ray.com/core/testing/assert"
|
|
)
|
|
|
|
func TestRequestOptionSet(t *testing.T) {
|
|
assert := assert.On(t)
|
|
|
|
var option RequestOption
|
|
assert.Bool(option.Has(RequestOptionChunkStream)).IsFalse()
|
|
|
|
option.Set(RequestOptionChunkStream)
|
|
assert.Bool(option.Has(RequestOptionChunkStream)).IsTrue()
|
|
|
|
option.Set(RequestOptionChunkMasking)
|
|
assert.Bool(option.Has(RequestOptionChunkMasking)).IsTrue()
|
|
assert.Bool(option.Has(RequestOptionChunkStream)).IsTrue()
|
|
}
|
|
|
|
func TestRequestOptionClear(t *testing.T) {
|
|
assert := assert.On(t)
|
|
|
|
var option RequestOption
|
|
option.Set(RequestOptionChunkStream)
|
|
option.Set(RequestOptionChunkMasking)
|
|
|
|
option.Clear(RequestOptionChunkStream)
|
|
assert.Bool(option.Has(RequestOptionChunkStream)).IsFalse()
|
|
assert.Bool(option.Has(RequestOptionChunkMasking)).IsTrue()
|
|
}
|