summaryrefslogtreecommitdiff
path: root/libpod/util_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/util_test.go')
-rw-r--r--libpod/util_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/libpod/util_test.go b/libpod/util_test.go
index 24e5fdfac..7b9d19a43 100644
--- a/libpod/util_test.go
+++ b/libpod/util_test.go
@@ -17,3 +17,13 @@ func TestStringInSlice(t *testing.T) {
// string is not in empty slice
assert.False(t, StringInSlice("one", []string{}))
}
+
+func TestRemoveScientificNotationFromFloat(t *testing.T) {
+ numbers := []float64{0.0, .5, 1.99999932, 1.04e+10}
+ results := []float64{0.0, .5, 1.99999932, 1.04}
+ for i, x := range numbers {
+ result, err := RemoveScientificNotationFromFloat(x)
+ assert.NoError(t, err)
+ assert.Equal(t, result, results[i])
+ }
+}