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

Function TestExpr_map_default_values

expr_test.go:1573–1587  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1571}
1572
1573func TestExpr_map_default_values(t *testing.T) {
1574 env := map[string]any{
1575 "foo": map[string]string{},
1576 "bar": map[string]*string{},
1577 }
1578
1579 input := `foo['missing'] == '' && bar['missing'] == nil`
1580
1581 program, err := expr.Compile(input, expr.Env(env))
1582 require.NoError(t, err)
1583
1584 output, err := expr.Run(program, env)
1585 require.NoError(t, err)
1586 require.Equal(t, true, output)
1587}
1588
1589func TestExpr_map_default_values_compile_check(t *testing.T) {
1590 tests := []struct {

Callers

nothing calls this directly

Calls 5

CompileFunction · 0.92
EnvStruct · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
EqualFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…