Fix output-related tests (#4288)

* Fix command tests

* More test fixes

* Use backticks to escape quoted strings

* More test fixes

* Fix mismatched error output failures

* Fix mismatched error output failures
This commit is contained in:
Calvin Leung Huang
2018-04-05 20:43:29 -04:00
committed by GitHub
parent 2859c20cb5
commit b9ff16a4d1
10 changed files with 27 additions and 27 deletions

View File

@@ -395,11 +395,11 @@ nope = "yes"
t.Fatal("expected error")
}
if !strings.Contains(err.Error(), "invalid key 'bad' on line 2") {
if !strings.Contains(err.Error(), `invalid key "bad" on line 2`) {
t.Errorf("bad error: %q", err)
}
if !strings.Contains(err.Error(), "invalid key 'nope' on line 3") {
if !strings.Contains(err.Error(), `invalid key "nope" on line 3`) {
t.Errorf("bad error: %q", err)
}
}
@@ -419,11 +419,11 @@ listener "tcp" {
t.Fatal("expected error")
}
if !strings.Contains(err.Error(), "listeners.tcp: invalid key 'bad' on line 3") {
if !strings.Contains(err.Error(), `listeners.tcp: invalid key "bad" on line 3`) {
t.Errorf("bad error: %q", err)
}
if !strings.Contains(err.Error(), "listeners.tcp: invalid key 'nope' on line 4") {
if !strings.Contains(err.Error(), `listeners.tcp: invalid key "nope" on line 4`) {
t.Errorf("bad error: %q", err)
}
}
@@ -443,11 +443,11 @@ telemetry {
t.Fatal("expected error")
}
if !strings.Contains(err.Error(), "telemetry: invalid key 'bad' on line 3") {
if !strings.Contains(err.Error(), `telemetry: invalid key "bad" on line 3`) {
t.Errorf("bad error: %q", err)
}
if !strings.Contains(err.Error(), "telemetry: invalid key 'nope' on line 4") {
if !strings.Contains(err.Error(), `telemetry: invalid key "nope" on line 4`) {
t.Errorf("bad error: %q", err)
}
}