v2ray-core/common/log/internal/log_entry_test.go

26 lines
514 B
Go
Raw Normal View History

2016-05-11 23:24:41 -07:00
package internal_test
import (
"testing"
2016-08-20 20:55:45 +02:00
. "v2ray.com/core/common/log/internal"
"v2ray.com/core/testing/assert"
2016-05-11 23:24:41 -07:00
)
func TestAccessLog(t *testing.T) {
2016-05-24 21:55:46 +02:00
assert := assert.On(t)
2016-05-11 23:24:41 -07:00
entry := &AccessLog{
2016-05-24 22:41:51 +02:00
From: "test_from",
To: "test_to",
2016-05-11 23:24:41 -07:00
Status: "Accepted",
2016-05-24 22:41:51 +02:00
Reason: "test_reason",
2016-05-11 23:24:41 -07:00
}
entryStr := entry.String()
2016-05-24 21:55:46 +02: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-11 23:24:41 -07:00
}