mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-23 02:26:49 -05:00
26 lines
461 B
Go
26 lines
461 B
Go
package blackhole_test
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
|
|
. "github.com/v2ray/v2ray-core/proxy/blackhole"
|
|
"github.com/v2ray/v2ray-core/testing/assert"
|
|
)
|
|
|
|
func TestHTTPResponseJSON(t *testing.T) {
|
|
assert := assert.On(t)
|
|
|
|
rawJson := `{
|
|
"response": {
|
|
"type": "http"
|
|
}
|
|
}`
|
|
config := new(Config)
|
|
err := json.Unmarshal([]byte(rawJson), config)
|
|
assert.Error(err).IsNil()
|
|
|
|
_, ok := config.Response.(*HTTPResponse)
|
|
assert.Bool(ok).IsTrue()
|
|
}
|