mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-11-17 17:12:21 -05:00
simplify test code
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Assertion is an assertion library inspired by Truth.
|
||||
// See http://google.github.io/truth/
|
||||
type Assertion struct {
|
||||
t *testing.T
|
||||
}
|
||||
@@ -29,3 +31,11 @@ func (a *Assertion) Byte(value byte) *ByteSubject {
|
||||
func (a *Assertion) Bytes(value []byte) *BytesSubject {
|
||||
return NewBytesSubject(NewSubject(a), value)
|
||||
}
|
||||
|
||||
func (a *Assertion) String(value string) *StringSubject {
|
||||
return NewStringSubject(NewSubject(a), value)
|
||||
}
|
||||
|
||||
func (a *Assertion) Error(value error) *ErrorSubject {
|
||||
return NewErrorSubject(NewSubject(a), value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user