MCPcopy Create free account
hub / github.com/facebook/time / TestPrepareExpressionNotEnoughValues

Function TestPrepareExpressionNotEnoughValues

fbclock/daemon/math_test.go:114–126  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestPrepareExpressionNotEnoughValues(t *testing.T) {
115 input := "mean(offset, 50)"
116 expr, err := prepareExpression(input)
117 require.Nil(t, err)
118
119 parameters := map[string]interface{}{
120 "offset": []float64{1, 2, 3, 4, 5},
121 }
122
123 r, err := expr.Evaluate(parameters)
124 require.NoError(t, err)
125 require.Equal(t, float64(3), r)
126}
127
128// TestPrepareExpressionMalformedInput reproduces OSS-Fuzz issue 471488972.
129func TestPrepareExpressionMalformedInput(t *testing.T) {

Callers

nothing calls this directly

Calls 1

prepareExpressionFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…