Debian Codegraph @

execution/func_to_string_test.go

raw symbols SCIP
1 package execution_test
2
3 import (
4 "github.com/tomwright/dasel/v3/model"
5 "testing"
6 )
7
8 func TestFuncToString(t *testing.T) {
9 t.Run("string", testCase{
10 s: `toString("Hello")`,
11 out: model.NewStringValue("Hello"),
12 }.run)
13 t.Run("int", testCase{
14 s: `toString(1)`,
15 out: model.NewStringValue("1"),
16 }.run)
17 t.Run("float", testCase{
18 s: `toString(1.1)`,
19 out: model.NewStringValue("1.1"),
20 }.run)
21 t.Run("bool", testCase{
22 s: `toString(true)`,
23 out: model.NewStringValue("true"),
24 }.run)
25 }