Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(67)

Side by Side Diff: src/pkg/fmt/fmt_test.go

Issue 2000041: code review 2000041: fmt/print: remove a TODO regarding printing renamed byt... (Closed)
Patch Set: code review 2000041: fmt/print: remove a TODO regarding printing renamed byt... Created 14 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/pkg/fmt/print.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package fmt_test 5 package fmt_test
6 6
7 import ( 7 import (
8 . "fmt" 8 . "fmt"
9 "io" 9 "io"
10 "math" 10 "math"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 fmtTest{"%v", renamedInt16(10), "10"}, 327 fmtTest{"%v", renamedInt16(10), "10"},
328 fmtTest{"%v", renamedInt32(-11), "-11"}, 328 fmtTest{"%v", renamedInt32(-11), "-11"},
329 fmtTest{"%X", renamedInt64(255), "FF"}, 329 fmtTest{"%X", renamedInt64(255), "FF"},
330 fmtTest{"%v", renamedUint(13), "13"}, 330 fmtTest{"%v", renamedUint(13), "13"},
331 fmtTest{"%o", renamedUint8(14), "16"}, 331 fmtTest{"%o", renamedUint8(14), "16"},
332 fmtTest{"%X", renamedUint16(15), "F"}, 332 fmtTest{"%X", renamedUint16(15), "F"},
333 fmtTest{"%d", renamedUint32(16), "16"}, 333 fmtTest{"%d", renamedUint32(16), "16"},
334 fmtTest{"%X", renamedUint64(17), "11"}, 334 fmtTest{"%X", renamedUint64(17), "11"},
335 fmtTest{"%o", renamedUintptr(18), "22"}, 335 fmtTest{"%o", renamedUintptr(18), "22"},
336 fmtTest{"%x", renamedString("thing"), "7468696e67"}, 336 fmtTest{"%x", renamedString("thing"), "7468696e67"},
337 » // TODO: It would be nice if this one worked, but it's hard. 337 » fmtTest{"%q", renamedBytes([]byte("hello")), `"hello"`},
338 » //» fmtTest{"%q", renamedBytes([]byte("hello")), `"hello"`},
339 fmtTest{"%v", renamedFloat(11), "11"}, 338 fmtTest{"%v", renamedFloat(11), "11"},
340 fmtTest{"%v", renamedFloat32(22), "22"}, 339 fmtTest{"%v", renamedFloat32(22), "22"},
341 fmtTest{"%v", renamedFloat64(33), "33"}, 340 fmtTest{"%v", renamedFloat64(33), "33"},
342 fmtTest{"%v", renamedComplex(7 + .2i), "(7+0.2i)"}, 341 fmtTest{"%v", renamedComplex(7 + .2i), "(7+0.2i)"},
343 fmtTest{"%v", renamedComplex64(3 + 4i), "(3+4i)"}, 342 fmtTest{"%v", renamedComplex64(3 + 4i), "(3+4i)"},
344 fmtTest{"%v", renamedComplex128(4 - 3i), "(4-3i)"}, 343 fmtTest{"%v", renamedComplex128(4 - 3i), "(4-3i)"},
345 344
346 // Formatter 345 // Formatter
347 fmtTest{"%x", F(1), "<x=F(1)>"}, 346 fmtTest{"%x", F(1), "<x=F(1)>"},
348 fmtTest{"%x", G(2), "2"}, 347 fmtTest{"%x", G(2), "2"},
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 } 598 }
600 s = Sprintln(f) 599 s = Sprintln(f)
601 if s != expect { 600 if s != expect {
602 t.Errorf("Sprintln wrong with Formatter: expected %q got %q\n", expect, s) 601 t.Errorf("Sprintln wrong with Formatter: expected %q got %q\n", expect, s)
603 } 602 }
604 s = Sprintf("%v\n", f) 603 s = Sprintf("%v\n", f)
605 if s != expect { 604 if s != expect {
606 t.Errorf("Sprintf wrong with Formatter: expected %q got %q\n", e xpect, s) 605 t.Errorf("Sprintf wrong with Formatter: expected %q got %q\n", e xpect, s)
607 } 606 }
608 } 607 }
OLDNEW
« no previous file with comments | « no previous file | src/pkg/fmt/print.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b