summaryrefslogtreecommitdiffstats
path: root/libgo/go/fmt/fmt_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/fmt/fmt_test.go')
-rw-r--r--libgo/go/fmt/fmt_test.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/libgo/go/fmt/fmt_test.go b/libgo/go/fmt/fmt_test.go
index ab064658d7c..dd5e5542523 100644
--- a/libgo/go/fmt/fmt_test.go
+++ b/libgo/go/fmt/fmt_test.go
@@ -96,7 +96,7 @@ type SI struct {
I interface{}
}
-// A type with a String method with pointer receiver for testing %p
+// P is a type with a String method with pointer receiver for testing %p.
type P int
var pValue P
@@ -676,7 +676,8 @@ func TestStructPrinter(t *testing.T) {
}
}
-// Check map printing using substrings so we don't depend on the print order.
+// presentInMap checks map printing using substrings so we don't depend on the
+// print order.
func presentInMap(s string, a []string, t *testing.T) {
for i := 0; i < len(a); i++ {
loc := strings.Index(s, a[i])
@@ -717,8 +718,8 @@ func TestEmptyMap(t *testing.T) {
}
}
-// Check that Sprint (and hence Print, Fprint) puts spaces in the right places,
-// that is, between arg pairs in which neither is a string.
+// TestBlank checks that Sprint (and hence Print, Fprint) puts spaces in the
+// right places, that is, between arg pairs in which neither is a string.
func TestBlank(t *testing.T) {
got := Sprint("<", 1, ">:", 1, 2, 3, "!")
expect := "<1>:1 2 3!"
@@ -727,8 +728,8 @@ func TestBlank(t *testing.T) {
}
}
-// Check that Sprintln (and hence Println, Fprintln) puts spaces in the right places,
-// that is, between all arg pairs.
+// TestBlankln checks that Sprintln (and hence Println, Fprintln) puts spaces in
+// the right places, that is, between all arg pairs.
func TestBlankln(t *testing.T) {
got := Sprintln("<", 1, ">:", 1, 2, 3, "!")
expect := "< 1 >: 1 2 3 !\n"
@@ -737,7 +738,7 @@ func TestBlankln(t *testing.T) {
}
}
-// Check Formatter with Sprint, Sprintln, Sprintf
+// TestFormatterPrintln checks Formatter with Sprint, Sprintln, Sprintf.
func TestFormatterPrintln(t *testing.T) {
f := F(1)
expect := "<v=F(1)>\n"
@@ -786,7 +787,7 @@ func TestWidthAndPrecision(t *testing.T) {
}
}
-// A type that panics in String.
+// Panic is a type that panics in String.
type Panic struct {
message interface{}
}
@@ -801,7 +802,7 @@ func (p Panic) String() string {
panic(p.message)
}
-// A type that panics in Format.
+// PanicF is a type that panics in Format.
type PanicF struct {
message interface{}
}
@@ -839,7 +840,7 @@ func TestPanics(t *testing.T) {
}
}
-// Test that erroneous String routine doesn't cause fatal recursion.
+// recurCount tests that erroneous String routine doesn't cause fatal recursion.
var recurCount = 0
type Recur struct {
OpenPOWER on IntegriCloud