From 15b2b5aa664af29268ce281ab921f9e4e92741d4 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Wed, 18 Feb 2015 02:56:40 +0100 Subject: [PATCH] Add tests for invalid uses of "offset". --- rules/rules_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rules/rules_test.go b/rules/rules_test.go index ca7394bc9..2661e24ab 100644 --- a/rules/rules_test.go +++ b/rules/rules_test.go @@ -633,6 +633,14 @@ func TestExpressions(t *testing.T) { `{group="production", instance="1", job="api-server"} => 0.06666666666666667 @[%v]`, }, }, + { + expr: `rate(http_requests[10m]) offset 5m`, + shouldFail: true, + }, + { + expr: `sum(http_requests) offset 5m`, + shouldFail: true, + }, } storage, closer := newTestStorage(t)