mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-19 23:03:08 +00:00
simplify testing
This commit is contained in:
1 parent
3582b9d869
commit
fc63f0432c
99 files changed
+726
-817
No files matched your search
@@ -5,12 +5,11 @@ import (
|
||||
|
||||
. "github.com/v2ray/v2ray-core/common/log/internal"
|
||||
"github.com/v2ray/v2ray-core/common/serial"
|
||||
v2testing "github.com/v2ray/v2ray-core/testing"
|
||||
"github.com/v2ray/v2ray-core/testing/assert"
|
||||
)
|
||||
|
||||
func TestAccessLog(t *testing.T) {
|
||||
v2testing.Current(t)
|
||||
assert := assert.On(t)
|
||||
|
||||
entry := &AccessLog{
|
||||
From: serial.StringT("test_from"),
|
||||
@@ -20,8 +19,8 @@ func TestAccessLog(t *testing.T) {
|
||||
}
|
||||
|
||||
entryStr := entry.String()
|
||||
assert.StringLiteral(entryStr).Contains(serial.StringT("test_from"))
|
||||
assert.StringLiteral(entryStr).Contains(serial.StringT("test_to"))
|
||||
assert.StringLiteral(entryStr).Contains(serial.StringT("test_reason"))
|
||||
assert.StringLiteral(entryStr).Contains(serial.StringT("Accepted"))
|
||||
assert.String(entryStr).Contains("test_from")
|
||||
assert.String(entryStr).Contains("test_to")
|
||||
assert.String(entryStr).Contains("test_reason")
|
||||
assert.String(entryStr).Contains("Accepted")
|
||||
}
|
||||
Reference in new issue
Block a user