mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 02:32:19 +08:00
mysql: began work on backend macro engine
This commit is contained in:
22
pkg/tsdb/mysql/macros_test.go
Normal file
22
pkg/tsdb/mysql/macros_test.go
Normal file
@ -0,0 +1,22 @@
|
||||
package mysql
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
func TestMacroEngine(t *testing.T) {
|
||||
Convey("MacroEngine", t, func() {
|
||||
|
||||
Convey("interpolate simple function", func() {
|
||||
engine := &MySqlMacroEngine{}
|
||||
|
||||
sql, err := engine.Interpolate("select $__time(time_column)")
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
So(sql, ShouldEqual, "select UNIX_TIMESTAMP(time_column) as time_sec")
|
||||
})
|
||||
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user