clbanning/mxj

prints in tests

Closed this issue · 4 comments

It seems to be a good idea to replace in tests fmt.Println to testing.T.Log. Because it's hard to look for my fail message during tests. What do you think?

I'm not sure. What tests are failing?

When I'm developing something, I move the tests that aren't relevant to a "tests" subdirectory so they don't run. I guess because so many of the tests have to be visually inspected anyway, it seems like writing them to a log file just means I've got to open up the log file to look at them anyway rather than scrolling the window back. (I do command-line development with OS X.)

I'll look in to it more next week when I'm off the road.

None of the tests are failing right now. When I was writing a test it bothered me that there is so much irrelevant output. I understood your workaround, but you can see the log in the terminal by doing: go test -run "TestYourMethod" -v. I am just asking your permission to fix it and I'm making sure that there isn't any particular reason for fmt.Println.

Haven't forgotten this but have been heads down on a project. Hope to spend time on this next week.

Can't think of fmt.Println() instances that aren't required for visual verification - marshaling from a map[string]interface{} there are no structural guarantees - but go ahead and take a shot at it. I haven't been able to free up enough to spend time on this right now.