Selaa lähdekoodia

fix log test for windows

v2ray 9 vuotta sitten
vanhempi
commit
760247a4ab
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 3 2
      common/log/log_test.go

+ 3 - 2
common/log/log_test.go

@@ -6,6 +6,7 @@ import (
 	"testing"
 
 	"github.com/v2ray/v2ray-core/common/serial"
+    "github.com/v2ray/v2ray-core/common/platform"
 	v2testing "github.com/v2ray/v2ray-core/testing"
 	"github.com/v2ray/v2ray-core/testing/assert"
 )
@@ -30,10 +31,10 @@ func TestStreamLogger(t *testing.T) {
 		logger: log.New(buffer, "", 0),
 	}
 	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()
 	errorLogger = infoLogger
 	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())
 }