1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-25 00:45:24 +00:00

test code for blackhole config

This commit is contained in:
v2ray 2016-07-24 13:40:27 +02:00
parent f871ca63e2
commit 0857fdb0f8
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -0,0 +1,25 @@
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()
}