summaryrefslogtreecommitdiffstats
path: root/modules/base/tool_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/base/tool_test.go')
-rw-r--r--modules/base/tool_test.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/modules/base/tool_test.go b/modules/base/tool_test.go
index 33677a910c..0c3e76704e 100644
--- a/modules/base/tool_test.go
+++ b/modules/base/tool_test.go
@@ -114,45 +114,6 @@ func TestFileSize(t *testing.T) {
assert.Equal(t, "2.0 EiB", FileSize(size))
}
-func TestSubtract(t *testing.T) {
- toFloat64 := func(n interface{}) float64 {
- switch v := n.(type) {
- case int:
- return float64(v)
- case int8:
- return float64(v)
- case int16:
- return float64(v)
- case int32:
- return float64(v)
- case int64:
- return float64(v)
- case float32:
- return float64(v)
- case float64:
- return v
- default:
- return 0.0
- }
- }
- values := []interface{}{
- int(-3),
- int8(14),
- int16(81),
- int32(-156),
- int64(1528),
- float32(3.5),
- float64(-15.348),
- }
- for _, left := range values {
- for _, right := range values {
- expected := toFloat64(left) - toFloat64(right)
- sub := Subtract(left, right)
- assert.InDelta(t, expected, sub, 1e-3)
- }
- }
-}
-
func TestEllipsisString(t *testing.T) {
assert.Equal(t, "...", EllipsisString("foobar", 0))
assert.Equal(t, "...", EllipsisString("foobar", 1))