remove spaces around arguments of macros

This commit is contained in:
Sven Klemm
2018-03-02 19:24:15 +01:00
parent f1ba9137c0
commit 4e826ff8f7
2 changed files with 15 additions and 3 deletions
+8
View File
@@ -49,6 +49,14 @@ func TestMacroEngine(t *testing.T) {
So(sql, ShouldEqual, "GROUP BY cast(cast(UNIX_TIMESTAMP(time_column)/(300) as signed)*300 as signed)")
})
Convey("interpolate __timeGroup function with spaces around arguments", func() {
sql, err := engine.Interpolate(query, timeRange, "GROUP BY $__timeGroup(time_column , '5m')")
So(err, ShouldBeNil)
So(sql, ShouldEqual, "GROUP BY cast(cast(UNIX_TIMESTAMP(time_column)/(300) as signed)*300 as signed)")
})
Convey("interpolate __timeTo function", func() {
sql, err := engine.Interpolate(query, timeRange, "select $__timeTo(time_column)")
So(err, ShouldBeNil)