1
0
mirror of https://github.com/golang/go synced 2024-11-12 04:30:22 -07:00

testing: add test for issue 5599

Update #5599

R=golang-dev, r, minux.ma
CC=golang-dev
https://golang.org/cl/9738052
This commit is contained in:
Dave Cheney 2013-05-31 23:03:22 +10:00
parent 9ba551bb87
commit 787976c739
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,31 @@
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package testing_test
import (
"testing"
)
var roundDownTests = []struct {
v, expected int
}{
{1, 1},
{9, 1},
{10, 1},
{11, 10},
{100, 10},
// {101, 100}, // issue 5599
{1000, 100},
// {1001, 1000}, // issue 5599
}
func TestRoundDown10(t *testing.T) {
for _, tt := range roundDownTests {
actual := testing.RoundDown10(tt.v)
if tt.expected != actual {
t.Errorf("roundDown10: expected %v, actual %v", tt.expected, actual)
}
}
}

View File

@ -0,0 +1,7 @@
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package testing
var RoundDown10 = roundDown10