- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for TestStringer (0.13 sec)
-
src/fmt/stringer_test.go
func (v TS) String() string { return Sprintf("S: %q", string(v)) } func check(t *testing.T, got, want string) { if got != want { t.Error(got, "!=", want) } } func TestStringer(t *testing.T) { s := Sprintf("%v %v %v %v %v", TI(0), TI8(1), TI16(2), TI32(3), TI64(4)) check(t, s, "I: 0 I8: 1 I16: 2 I32: 3 I64: 4") s = Sprintf("%v %v %v %v %v %v", TU(5), TU8(6), TU16(7), TU32(8), TU64(9), TUI(10))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Sep 08 04:08:51 UTC 2014 - 2.1K bytes - Viewed (0) -
src/html/template/content_test.go
return fmt.Sprintf("string=%d", s.v) } type errorer struct { v int } func (s *errorer) Error() string { return fmt.Sprintf("error=%d", s.v) } func TestStringer(t *testing.T) { s := &myStringer{3} b := new(strings.Builder) tmpl := Must(New("x").Parse("{{.}}")) if err := tmpl.Execute(b, s); err != nil { t.Fatal(err) } var expect = "string=3"
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 06 15:48:16 UTC 2022 - 13.5K bytes - Viewed (0)