Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in test #30

Merged
merged 1 commit into from
Feb 27, 2018
Merged

Fix typo in test #30

merged 1 commit into from
Feb 27, 2018

Conversation

rjammala
Copy link

No description provided.

@@ -152,7 +152,7 @@ func TestCustomLogHook(t *testing.T) {

// in the event of an error, let's see what the logs were
if expectedRetries != len(errorLines) {
t.Errorf("Expected %d lines to be emitted. Got %d", expectedRetries, errorLines)
t.Errorf("Expected %d lines to be emitted. Got %d", expectedRetries, len(errorLines))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errorLines := []ErrEntry{}
The current test, with the %d, is just saying "hey, these numbers don't match."
If you want to see the actual individual ErrEntry values, we would have to change %d to %v. By keeping the %d, I would expect the fmt statement to say something like:

Expected 3 lines to be emitted. Got %!d(ErrEntry=something)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this fix, I get the following failure:

_/Users/raj/pester

./pester_test.go:155: Errorf format %d has arg errorLines of wrong type []pester.ErrEntry
FAIL _/Users/raj/pester [build failed]

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh! I totally read it backwards (facepalm).

@sethgrid sethgrid merged commit ed9870d into sethgrid:master Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants