1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-15 16:38:16 -04:00
v2fly/common/log/internal/log_entry_test.go

27 lines
633 B
Go
Raw Normal View History

2016-05-12 02:24:41 -04:00
package internal_test
import (
"testing"
. "github.com/v2ray/v2ray-core/common/log/internal"
"github.com/v2ray/v2ray-core/common/serial"
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestAccessLog(t *testing.T) {
2016-05-24 15:55:46 -04:00
assert := assert.On(t)
2016-05-12 02:24:41 -04:00
entry := &AccessLog{
2016-05-23 14:23:40 -04:00
From: serial.StringT("test_from"),
To: serial.StringT("test_to"),
2016-05-12 02:24:41 -04:00
Status: "Accepted",
2016-05-23 14:23:40 -04:00
Reason: serial.StringT("test_reason"),
2016-05-12 02:24:41 -04:00
}
entryStr := entry.String()
2016-05-24 15:55:46 -04:00
assert.String(entryStr).Contains("test_from")
assert.String(entryStr).Contains("test_to")
assert.String(entryStr).Contains("test_reason")
assert.String(entryStr).Contains("Accepted")
2016-05-12 02:24:41 -04:00
}