mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
testing: shorten some tests.
These are the top runners. More to come. Also print two digits of timing info under -test.v. R=rsc CC=golang-dev https://golang.org/cl/4317044
This commit is contained in:
parent
4cb660aad8
commit
f0cf7d296c
11 changed files with 77 additions and 31 deletions
|
|
@ -617,7 +617,11 @@ func equal(m string, s1, s2 string, t *testing.T) bool {
|
|||
|
||||
func TestCaseConsistency(t *testing.T) {
|
||||
// Make a string of all the runes.
|
||||
a := make([]int, unicode.MaxRune+1)
|
||||
numRunes := unicode.MaxRune + 1
|
||||
if testing.Short() {
|
||||
numRunes = 1000
|
||||
}
|
||||
a := make([]int, numRunes)
|
||||
for i := range a {
|
||||
a[i] = i
|
||||
}
|
||||
|
|
@ -627,10 +631,10 @@ func TestCaseConsistency(t *testing.T) {
|
|||
lower := ToLower(s)
|
||||
|
||||
// Consistency checks
|
||||
if n := utf8.RuneCountInString(upper); n != unicode.MaxRune+1 {
|
||||
if n := utf8.RuneCountInString(upper); n != numRunes {
|
||||
t.Error("rune count wrong in upper:", n)
|
||||
}
|
||||
if n := utf8.RuneCountInString(lower); n != unicode.MaxRune+1 {
|
||||
if n := utf8.RuneCountInString(lower); n != numRunes {
|
||||
t.Error("rune count wrong in lower:", n)
|
||||
}
|
||||
if !equal("ToUpper(upper)", ToUpper(upper), upper, t) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue