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