Home | History | Annotate | Download | only in reflect

Lines Matching defs:String

42 	c string
48 s string
51 func assert(t *testing.T, s, want string) {
75 {struct{ x (map[string]int32) }{}, "map[string]int32"},
76 {struct{ x (chan<- string) }{}, "chan<- string"},
189 {new(string), "stringy cheese"},
195 {new(map[string]int32), "map[string]int32{<can't iterate on maps>}"},
196 {new(chan<- string), "chan<- string"},
222 func testType(t *testing.T, i int, typ Type, want string) {
223 s := typ.String()
268 case String:
312 case String:
395 m := make(map[string]int)
433 typ = TypeOf((map[string]*int32)(nil))
434 testType(t, 9, typ, "map[string]*int32")
436 testType(t, 10, mtyp.Key(), "string")
439 typ = TypeOf((chan<- string)(nil))
440 testType(t, 12, typ, "chan<- string")
441 testType(t, 13, typ.Elem(), "string")
457 assert(t, v2.Type().String(), "interface {}")
460 assert(t, v3.Type().String(), "float64")
470 assert(t, v2.Type().String(), "interface {}")
472 assert(t, v3.Type().String(), "float64")
486 assert(t, v.Type().String(), "func()")
679 {map[int]string{1: "one", 2: "two"}, map[int]string{2: "two", 1: "one"}, true},
692 {map[int]string{1: "one", 3: "two"}, map[int]string{2: "two", 1: "one"}, false},
693 {map[int]string{1: "one", 2: "txo"}, map[int]string{2: "two", 1: "one"}, false},
694 {map[int]string{1: "one"}, map[int]string{2: "two", 1: "one"}, false},
695 {map[int]string{2: "two", 1: "one"}, map[int]string{1: "one"}, false},
724 {map[uint]string{1: "one", 2: "two"}, map[int]string{2: "two", 1: "one"}, false},
778 c *string
865 t.Errorf("value of type %v should not be nil", ValueOf(a).Type().String())
875 struct{ x map[string]int }{},
878 struct{ x []string }{},
950 m := map[string]int{"a": 1, "b": 2}
962 if kv.String() == k {
985 newm := newmap.Interface().(map[string]int)
1011 var m map[string]int
1025 var mbig map[string][10 << 20]byte
1135 desc string
1157 c := make(chan string, cap)
1448 func fmtSelect(info []caseInfo) string {
1465 return buf.String()
1550 fv := ValueOf(func(a, b string) {})
1966 CheckF := func(name string, f func(int, byte) (byte, int), inc int) {
1973 CheckV := func(name string, i Value, inc int) {
1986 CheckI := func(name string, i interface{}, inc int) {
2059 a string
2078 name string
2285 path string
2307 {TypeOf(string("")), ""},
2312 {TypeOf(map[string]int{}), ""},
2326 Exported string
2327 unexported string
2333 pkgPath string
2337 checkPkgPath := func(name string, s []pkgpathTest) {
2678 vs := ValueOf(s).Slice(3, 5).Interface().(string)
2776 if b.String() != "hello, 42 world" {
2777 String(), "hello 42 world")
2782 if b.String() != "hello, 42 world" {
2783 t.Errorf("after Fprintf CallSlice: %q != %q", b.String(), "hello 42 world")
2798 B string
2818 Key string
2819 Value string
2875 S string
3118 x := string("hello")
3147 type MyString string
3165 var numbers = []string{
3368 // string
3369 {V(string("hello")), V(string("hello"))},
3370 {V(string("bytes1")), V([]byte("bytes1"))},
3371 {V([]byte("bytes2")), V(string("bytes2"))},
3373 {V(string("runes?")), V([]rune("runes?"))},
3374 {V([]rune("runes?")), V(string("runes?"))},
3376 {V(int('a')), V(string("a"))},
3377 {V(int8('a')), V(string("a"))},
3378 {V(int16('a')), V(string("a"))},
3379 {V(int32('a')), V(string("a"))},
3380 {V(int64('a')), V(string("a"))},
3381 {V(uint('a')), V(string("a"))},
3382 {V(uint8('a')), V(string("a"))},
3383 {V(uint16('a')), V(string("a"))},
3384 {V(uint32('a')), V(string("a"))},
3385 {V(uint64('a')), V(string("a"))},
3386 {V(uintptr('a')), V(string("a"))},
3387 {V(int(-1)), V(string("\uFFFD"))},
3388 {V(int8(-2)), V(string("\uFFFD"))},
3389 {V(int16(-3)), V(string("\uFFFD"))},
3390 {V(int32(-4)), V(string("\uFFFD"))},
3391 {V(int64(-5)), V(string("\uFFFD"))},
3392 {V(uint(0x110001)), V(string("\uFFFD"))},
3393 {V(uint32(0x110002)), V(string("\uFFFD"))},
3394 {V(uint64(0x110003)), V(string("\uFFFD"))},
3395 {V(uintptr(0x110004)), V(string("\uFFFD"))},
3397 // named string
3398 {V(MyString("hello")), V(string("hello"))},
3399 {V(string("hello")), V(MyString("hello"))},
3400 {V(string("hello")), V(string("hello"))},
3432 {V(string("bytes1")), V(MyBytes("bytes1"))},
3433 {V(MyBytes("bytes2")), V(string("bytes2"))},
3439 {V(string("runes?")), V(MyRunes("runes?"))},
3440 {V(MyRunes("runes?")), V(string("runes?"))},
3516 {V((chan string)(nil)), V((<-chan string)(nil))},
3517 {V((chan string)(nil)), V((chan<- string)(nil))},
3531 {V(string("hello")), EmptyInterfaceV(string("hello"))},
3622 Y map[string]int
3634 {TypeOf(map[string]int{}), false},
3641 {TypeOf([10]map[string]int{}), false},
3642 {TypeOf([10]string{}), true},
3705 want string
3727 value: func(i int) interface{} { type Tstring string; return Tstring(strconv.Itoa(i)) },
3869 at1 := ArrayOf(5, TypeOf(string("")))
3884 v2.Index(0).Index(0).Set(ValueOf((v1.Index(0).Index(0).String() + " ")[:3]))
3940 if got, want := st.String(), "[]reflect_test.T"; got != want {
3941 t.Errorf("SliceOf(T(1)).String()=%q, want %q", got, want)
4042 const stStr = `struct { S string "s"; X uint8 "x"; Y uint64; Z [3]uint16 }`
4043 if got, want := st.String(), stStr; got != want {
4044 t.Errorf("StructOf(fields).String()=%q, want %q", got, want)
4049 String string
4106 StructField{Name: "string", Type: TypeOf("")},
4107 StructField{Name: "string", Type: TypeOf("")},
4113 StructField{Name: "string", Type: TypeOf("")},
4293 func isExported(name string) bool {
4351 {Name: "Y", Type: TypeOf(string(""))},
4618 type T string
4629 s1 := sv1.String()
4630 s2 := sv2.String()
4642 type T string
4651 // check String form of ChanDir
4652 if crt.ChanDir().String() != "<-chan" {
4653 t.Errorf("chan dir: have %q, want %q", crt.ChanDir().String(), "<-chan")
4655 if cst.ChanDir().String() != "chan<-" {
4656 t.Errorf("chan dir: have %q, want %q", cst.ChanDir().String(), "chan<-")
4710 type K string
4804 var last string
4815 type K string
4823 } else if args[0].String() != "gopher" {
4824 t.Errorf("args[0] = %q, want %q", args[0].String(), "gopher")
4852 {in: []Type{TypeOf(int(0))}, out: []Type{TypeOf(false), TypeOf("")}, want: (func(int) (bool, string))(nil)},
5265 if rv.String() != "<reflect_test.Impl Value>" {
5266 t.Errorf("ValueOf(Impl{}).String() = %q, want %q", rv.String(), "<reflect_test.Impl Value>")
5270 if method.String() != "<func() Value>" {
5271 t.Errorf("ValueOf(Impl{}).Method(0).String() = %q, want %q", method.String(), "<func() Value>")
5332 f := func(a, b, c, d, e string) {
5339 f2 := MakeFunc(typ, g).Interface().(func(string, string, string, string, string))
5430 ValueOf(func(a, b string) string { return "" }).Type(),
5773 check := func(name string, typ Type) {
5774 if underlying := TypeOf(typ).String(); underlying != "*reflect.rtype" {
5792 func (*XM) String() string { return "" }
5836 want string
5915 want string
5922 {TypeOf(new(XM).String), "func() string"},
5923 {TypeOf(new(XM)).Method(0).Type, "func(*reflect_test.XM) string"},
5929 if got, want := test.typ.String(), test.want; got != want {
5930 t.Errorf("type %d String()=%q, want %q", i, got, want)
5967 type S string
6005 in: []string{"eric", "sergey", "larry"},
6008 want: []string{"larry", "sergey", "eric"},