all: typo fix: exptected -> expected

This commit is contained in:
Aliaksandr Valialkin 2020-07-02 18:05:36 +03:00
parent 5d3db3ff7c
commit e5500bfcf2
5 changed files with 11 additions and 11 deletions

View file

@ -373,7 +373,7 @@ func checkMetricsResult(got, want []Metric) error {
want = removeIfFoundMetrics(r, want) want = removeIfFoundMetrics(r, want)
} }
if len(want) > 0 { if len(want) > 0 {
return fmt.Errorf("exptected metrics %+v not found in %+v", want, got) return fmt.Errorf("expected metrics %+v not found in %+v", want, got)
} }
return nil return nil
} }

View file

@ -70,13 +70,13 @@ func TestParseBad(t *testing.T) {
func TestRule_Validate(t *testing.T) { func TestRule_Validate(t *testing.T) {
if err := (&Rule{}).Validate(); err == nil { if err := (&Rule{}).Validate(); err == nil {
t.Errorf("exptected empty name error") t.Errorf("expected empty name error")
} }
if err := (&Rule{Alert: "alert"}).Validate(); err == nil { if err := (&Rule{Alert: "alert"}).Validate(); err == nil {
t.Errorf("exptected empty expr error") t.Errorf("expected empty expr error")
} }
if err := (&Rule{Alert: "alert", Expr: "test>0"}).Validate(); err != nil { if err := (&Rule{Alert: "alert", Expr: "test>0"}).Validate(); err != nil {
t.Errorf("exptected valid rule; got %s", err) t.Errorf("expected valid rule; got %s", err)
} }
} }

View file

@ -29,7 +29,7 @@ func TestVMSelectQuery(t *testing.T) {
t.Errorf("expected %s:%s as basic auth got %s:%s", basicAuthName, basicAuthPass, name, pass) t.Errorf("expected %s:%s as basic auth got %s:%s", basicAuthName, basicAuthPass, name, pass)
} }
if r.URL.Query().Get("query") != query { if r.URL.Query().Get("query") != query {
t.Errorf("exptected %s in query param, got %s", query, r.URL.Query().Get("query")) t.Errorf("expected %s in query param, got %s", query, r.URL.Query().Get("query"))
} }
switch c { switch c {
case 0: case 0:
@ -76,7 +76,7 @@ func TestVMSelectQuery(t *testing.T) {
t.Fatalf("unexpected %s", err) t.Fatalf("unexpected %s", err)
} }
if len(m) != 1 { if len(m) != 1 {
t.Fatalf("exptected 1 metric got %d in %+v", len(m), m) t.Fatalf("expected 1 metric got %d in %+v", len(m), m)
} }
expected := Metric{ expected := Metric{
Labels: []Label{{Value: "vm_rows", Name: "__name__"}}, Labels: []Label{{Value: "vm_rows", Name: "__name__"}},

View file

@ -41,7 +41,7 @@ func TestGetAlertURLGenerator(t *testing.T) {
} }
_, err = getAlertURLGenerator(nil, "foo?{{invalid}}", true) _, err = getAlertURLGenerator(nil, "foo?{{invalid}}", true)
if err == nil { if err == nil {
t.Errorf("exptected tempalte validation error got nil") t.Errorf("expected tempalte validation error got nil")
} }
fn, err = getAlertURLGenerator(u, "foo?query={{$value}}", true) fn, err = getAlertURLGenerator(u, "foo?query={{$value}}", true)
if err != nil { if err != nil {

View file

@ -52,16 +52,16 @@ func TestAlertManager_Send(t *testing.T) {
t.Errorf("expected 1 alert in array got %d", len(a)) t.Errorf("expected 1 alert in array got %d", len(a))
} }
if a[0].GeneratorURL != "0/0" { if a[0].GeneratorURL != "0/0" {
t.Errorf("exptected 0/0 as generatorURL got %s", a[0].GeneratorURL) t.Errorf("expected 0/0 as generatorURL got %s", a[0].GeneratorURL)
} }
if a[0].Labels["alertname"] != "alert0" { if a[0].Labels["alertname"] != "alert0" {
t.Errorf("exptected alert0 as alert name got %s", a[0].Labels["alertname"]) t.Errorf("expected alert0 as alert name got %s", a[0].Labels["alertname"])
} }
if a[0].StartsAt.IsZero() { if a[0].StartsAt.IsZero() {
t.Errorf("exptected non-zero start time") t.Errorf("expected non-zero start time")
} }
if a[0].EndAt.IsZero() { if a[0].EndAt.IsZero() {
t.Errorf("exptected non-zero end time") t.Errorf("expected non-zero end time")
} }
} }
}) })