mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
27 lines
388 B
Go
27 lines
388 B
Go
package expr
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestNewCommand(t *testing.T) {
|
|
cmd, err := NewSQLCommand("a", "select a from foo, bar")
|
|
if err != nil && strings.Contains(err.Error(), "feature is not enabled") {
|
|
return
|
|
}
|
|
|
|
if err != nil {
|
|
t.Fail()
|
|
return
|
|
}
|
|
|
|
for _, v := range cmd.varsToQuery {
|
|
if strings.Contains("foo bar", v) {
|
|
continue
|
|
}
|
|
t.Fail()
|
|
return
|
|
}
|
|
}
|