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