代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/telegraf 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package influxdb_test
import (
"github.com/influxdata/influxdb/v2/kit/platform/errors"
"testing"
"github.com/influxdata/influxdb/v2"
influxTesting "github.com/influxdata/influxdb/v2/testing"
)
func TestTagValid(t *testing.T) {
cases := []struct {
name string
src influxdb.TagRule
err error
}{
{
name: "regular status rule",
src: influxdb.TagRule{
Tag: influxdb.Tag{Key: "k1", Value: "v1"},
Operator: influxdb.Equal,
},
},
{
name: "empty",
src: influxdb.TagRule{},
err: &errors.Error{
Code: errors.EInvalid,
Msg: "tag must contain a key and a value",
},
},
{
name: "empty key",
src: influxdb.TagRule{
Tag: influxdb.Tag{Value: "v1"},
},
err: &errors.Error{
Code: errors.EInvalid,
Msg: "tag must contain a key and a value",
},
},
{
name: "empty value",
src: influxdb.TagRule{
Tag: influxdb.Tag{Key: "k1"},
},
err: &errors.Error{
Code: errors.EInvalid,
Msg: "tag must contain a key and a value",
},
},
{
name: "invalid operator",
src: influxdb.TagRule{
Tag: influxdb.Tag{Key: "k1", Value: "v1"},
Operator: influxdb.Operator(-1),
},
err: &errors.Error{
Code: errors.EInvalid,
Msg: "Operator is invalid",
},
},
}
for _, c := range cases {
err := c.src.Valid()
influxTesting.ErrorsEqual(t, err, c.err)
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。