MCPcopy Create free account
hub / github.com/expr-lang/expr / TestPrint_ConstantNode

Function TestPrint_ConstantNode

ast/print_test.go:110–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

108}
109
110func TestPrint_ConstantNode(t *testing.T) {
111 tests := []struct {
112 input any
113 want string
114 }{
115 {nil, `nil`},
116 {true, `true`},
117 {false, `false`},
118 {1, `1`},
119 {1.1, `1.1`},
120 {"a", `"a"`},
121 {[]int{1, 2, 3}, `[1,2,3]`},
122 {map[string]int{"a": 1}, `{"a":1}`},
123 }
124
125 for _, tt := range tests {
126 t.Run(tt.want, func(t *testing.T) {
127 node := &ast.ConstantNode{
128 Value: tt.input,
129 }
130 require.Equal(t, tt.want, node.String())
131 })
132 }
133}

Callers

nothing calls this directly

Calls 3

StringMethod · 0.95
EqualFunction · 0.92
RunMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…