2016-05-12 06:24:41 +00:00
|
|
|
package internal_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2017-02-01 20:35:40 +00:00
|
|
|
. "v2ray.com/core/app/log/internal"
|
2017-10-24 14:15:35 +00:00
|
|
|
. "v2ray.com/ext/assert"
|
2016-05-12 06:24:41 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestAccessLog(t *testing.T) {
|
2017-10-24 14:15:35 +00:00
|
|
|
assert := With(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()
|
2017-10-24 14:15:35 +00:00
|
|
|
assert(entryStr, HasSubstring, "test_from")
|
|
|
|
assert(entryStr, HasSubstring, "test_to")
|
|
|
|
assert(entryStr, HasSubstring, "test_reason")
|
|
|
|
assert(entryStr, HasSubstring, "Accepted")
|
2016-05-12 06:24:41 +00:00
|
|
|
}
|