github.com/containers/podman/v4@v4.9.4/libpod/util_test.go (about)

     1  //go:build !remote
     2  // +build !remote
     3  
     4  package libpod
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/containers/podman/v4/utils"
    10  	"github.com/stretchr/testify/assert"
    11  )
    12  
    13  func TestRemoveScientificNotationFromFloat(t *testing.T) {
    14  	numbers := []float64{0.0, .5, 1.99999932, 1.04e+10}
    15  	results := []float64{0.0, .5, 1.99999932, 1.04}
    16  	for i, x := range numbers {
    17  		result, err := utils.RemoveScientificNotationFromFloat(x)
    18  		assert.NoError(t, err)
    19  		assert.Equal(t, result, results[i])
    20  	}
    21  }