1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-07 02:38:10 -05:00
v2fly/common/log/internal/log_entry_test.go
2016-05-23 20:23:40 +02:00

28 lines
772 B
Go

package internal_test
import (
"testing"
. "github.com/v2ray/v2ray-core/common/log/internal"
"github.com/v2ray/v2ray-core/common/serial"
v2testing "github.com/v2ray/v2ray-core/testing"
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestAccessLog(t *testing.T) {
v2testing.Current(t)
entry := &AccessLog{
From: serial.StringT("test_from"),
To: serial.StringT("test_to"),
Status: "Accepted",
Reason: serial.StringT("test_reason"),
}
entryStr := entry.String()
assert.StringLiteral(entryStr).Contains(serial.StringT("test_from"))
assert.StringLiteral(entryStr).Contains(serial.StringT("test_to"))
assert.StringLiteral(entryStr).Contains(serial.StringT("test_reason"))
assert.StringLiteral(entryStr).Contains(serial.StringT("Accepted"))
}