summaryrefslogtreecommitdiffstats
path: root/helpers/general_test.go
diff options
context:
space:
mode:
authorbep <bjorn.erik.pedersen@gmail.com>2015-04-05 21:03:16 +0200
committerspf13 <steve.francia@gmail.com>2015-05-08 22:27:00 -0400
commita52e508d4628da4c976f4fe3f55eab2293686ee6 (patch)
treef8354719b2fd0d7c5c92ef8da1fc72becaee82c8 /helpers/general_test.go
parent2b91b480d01cfcd4b13922effb25d83bc5dd3fb2 (diff)
Update test logs for uniformity and consistency
Many minor fixes to make test logs more consistent and correct a mispelling. Standardize on "[%i] got X but expected Y" for log messages. Using a consistent layout makes it easier to read the test results. This was mostly changing "Got" to "got". Swapped the order of values on several calls to bring them in line with the convention. A few log messages had a sequence number added to identify the exact scenario that failed. Otherwise, there would be no way to ascertain which failed When there are many scenarios. Correct spelling of "expected." Fixes #1028 Merged be2097e1ad789eca5d893805a059d94defbe5c48 [close #1040]
Diffstat (limited to 'helpers/general_test.go')
-rw-r--r--helpers/general_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/helpers/general_test.go b/helpers/general_test.go
index 0147822c7..31c478200 100644
--- a/helpers/general_test.go
+++ b/helpers/general_test.go
@@ -28,7 +28,7 @@ func TestGuessType(t *testing.T) {
} {
result := GuessType(this.in)
if result != this.expect {
- t.Errorf("[%d] GuessType guessed wrong, expected %s, got %s", i, this.expect, result)
+ t.Errorf("[%d] got %s but expected %s", i, result, this.expect)
}
}
}
@@ -109,7 +109,7 @@ func TestReaderContains(t *testing.T) {
for i, this := range append(containsBenchTestData, containsAdditionalTestData...) {
result := ReaderContains(StringToReader(this.v1), this.v2)
if result != this.expect {
- t.Errorf("[%d] Got %t but expected %t", i, result, this.expect)
+ t.Errorf("[%d] got %t but expected %t", i, result, this.expect)
}
}
@@ -123,7 +123,7 @@ func BenchmarkReaderContains(b *testing.B) {
for i, this := range containsBenchTestData {
result := ReaderContains(StringToReader(this.v1), this.v2)
if result != this.expect {
- b.Errorf("[%d] Got %t but expected %t", i, result, this.expect)
+ b.Errorf("[%d] got %t but expected %t", i, result, this.expect)
}
}
}
@@ -140,7 +140,7 @@ func _BenchmarkReaderContains(b *testing.B) {
}
result := bytes.Contains(bs, this.v2)
if result != this.expect {
- b.Errorf("[%d] Got %t but expected %t", i, result, this.expect)
+ b.Errorf("[%d] got %t but expected %t", i, result, this.expect)
}
}
}
@@ -167,10 +167,10 @@ func TestInStringArrayCaseSensitive(t *testing.T) {
{"Albert", true},
{"ALBERT", false},
}
- for _, in := range data {
+ for i, in := range data {
output := InStringArray(array, in.input)
if output != in.expected {
- t.Errorf("TestInStringArrayCase failed. Expected %t. Got %t.", in.expected, output)
+ t.Errorf("[%d] got %t but expected %t", i, output, in.expected)
}
}
}