1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-05 11:34:32 -04:00
v2fly/app/log/internal/log_entry_test.go

26 lines
491 B
Go
Raw Normal View History

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
}