From e7c77f7b4097eb4ddcde99aed2a9296870b79052 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 29 Apr 2024 12:38:27 +0100 Subject: [PATCH] promql: export NewTestQuery So that tests can call it from another package. Signed-off-by: Bryan Boreham --- promql/engine.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/promql/engine.go b/promql/engine.go index b8a8ea095..08c787d5c 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -573,7 +573,8 @@ func (ng *Engine) validateOpts(expr parser.Expr) error { return validationErr } -func (ng *Engine) newTestQuery(f func(context.Context) error) Query { +// NewTestQuery: inject special behaviour into Query for testing. +func (ng *Engine) NewTestQuery(f func(context.Context) error) Query { qry := &query{ q: "test statement", stmt: parser.TestStmt(f),