1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-18 18:36:11 -05:00
v2fly/proxy/blackhole/config_json_test.go

28 lines
451 B
Go
Raw Normal View History

2016-08-08 17:53:07 -04:00
// +build json
2016-07-24 07:40:27 -04:00
package blackhole_test
import (
"encoding/json"
"testing"
2016-08-20 14:55:45 -04:00
. "v2ray.com/core/proxy/blackhole"
"v2ray.com/core/testing/assert"
2016-07-24 07:40:27 -04:00
)
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()
}