MCPcopy
hub / github.com/expr-lang/expr / TestRaceCondition_variables

Function TestRaceCondition_variables

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

Source from the content-addressed store, hash-verified

2556}
2557
2558func TestRaceCondition_variables(t *testing.T) {
2559 program, err := expr.Compile(`let foo = 1; foo + 1`, expr.Env(mock.Env{}))
2560 require.NoError(t, err)
2561
2562 var wg sync.WaitGroup
2563
2564 for i := 0; i < 10; i++ {
2565 wg.Add(1)
2566 go func() {
2567 defer wg.Done()
2568 out, err := expr.Run(program, mock.Env{})
2569 require.NoError(t, err)
2570 require.Equal(t, 2, out)
2571 }()
2572 }
2573
2574 wg.Wait()
2575}
2576
2577func TestOperatorDependsOnEnv(t *testing.T) {
2578 env := map[string]any{

Callers

nothing calls this directly

Calls 6

CompileFunction · 0.92
EnvStruct · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
EqualFunction · 0.92
AddMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…