Files
grafana/pkg/tsdb/influxdb/influxql/util/util_test.go
ismail simsek 14e55fefbb InfluxDB: Check the value type before casting it to the string (#80986)
* Check the value type before casting it to the string

* set visualization as table by default

* append all values for show diagnostics

* golangci-lint

* append metadata only to first frame
2024-01-25 11:28:25 +01:00

24 lines
457 B
Go

package util
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestParseString(t *testing.T) {
t.Run("parse bool value to string", func(t *testing.T) {
val := true
expected := ToPtr("true")
result := ParseString(val)
require.Equal(t, expected, result)
})
t.Run("parse number value to string", func(t *testing.T) {
val := 123
expected := ToPtr("123")
result := ParseString(val)
require.Equal(t, expected, result)
})
}