1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-06 20:14:31 -04:00
v2fly/common/log/internal/log_entry_test.go

26 lines
540 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/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-24 16:41:51 -04:00
From: "test_from",
To: "test_to",
2016-05-12 02:24:41 -04:00
Status: "Accepted",
2016-05-24 16:41:51 -04:00
Reason: "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
}