1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-10-01 08:16:00 -04:00

fix log test for windows

This commit is contained in:
v2ray 2016-03-24 23:36:06 +08:00
parent 40945f2967
commit 760247a4ab

View File

@ -6,6 +6,7 @@ import (
"testing" "testing"
"github.com/v2ray/v2ray-core/common/serial" "github.com/v2ray/v2ray-core/common/serial"
"github.com/v2ray/v2ray-core/common/platform"
v2testing "github.com/v2ray/v2ray-core/testing" v2testing "github.com/v2ray/v2ray-core/testing"
"github.com/v2ray/v2ray-core/testing/assert" "github.com/v2ray/v2ray-core/testing/assert"
) )
@ -30,10 +31,10 @@ func TestStreamLogger(t *testing.T) {
logger: log.New(buffer, "", 0), logger: log.New(buffer, "", 0),
} }
Info("Test ", "Stream Logger", " Format") Info("Test ", "Stream Logger", " Format")
assert.StringLiteral(string(buffer.Bytes())).Equals("[Info]Test Stream Logger Format\n") assert.StringLiteral(string(buffer.Bytes())).Equals("[Info]Test Stream Logger Format" + platform.LineSeparator())
buffer.Reset() buffer.Reset()
errorLogger = infoLogger errorLogger = infoLogger
Error("Test ", serial.StringLiteral("literal"), " Format") Error("Test ", serial.StringLiteral("literal"), " Format")
assert.StringLiteral(string(buffer.Bytes())).Equals("[Error]Test literal Format\n") assert.StringLiteral(string(buffer.Bytes())).Equals("[Error]Test literal Format" + platform.LineSeparator())
} }