string_test.go 455 B

123456789101112131415161718192021222324
  1. package serial_test
  2. import (
  3. "testing"
  4. . "github.com/v2ray/v2ray-core/common/serial"
  5. v2testing "github.com/v2ray/v2ray-core/testing"
  6. "github.com/v2ray/v2ray-core/testing/assert"
  7. )
  8. type TestString struct {
  9. value string
  10. }
  11. func (this *TestString) String() string {
  12. return this.value
  13. }
  14. func TestNewStringSerial(t *testing.T) {
  15. v2testing.Current(t)
  16. testString := &TestString{value: "abcd"}
  17. assert.String(NewStringT(testString)).Equals("abcd")
  18. }