matryer / silk

Markdown based document-driven RESTful API testing.
http://silktest.org/
GNU General Public License v2.0
942 stars 67 forks source link

``clean()`` makes error messages confusing when you expect strings with facing and/or trailing spaces #28

Closed craftgear closed 8 years ago

craftgear commented 8 years ago

When you have actual data strings with facing and/or trailing spaces, error messages are confusing.

For example an actual data is " expected" then error message is:

Data[9].title expected string: "expected"  actual string: "expected"  

In this case actual string should be shown with a facing space.

clean() function causes this. https://github.com/matryer/silk/blob/87124e93cc78cbee0f495245e5eace81f3ad7b08/parse/detail.go#L41

Are these Trim callings really necessary?

matryer commented 8 years ago

Perhaps we shouldn't clean when reporting errors?

craftgear commented 8 years ago

I think it would be a nice feature.

matryer commented 8 years ago

Anyone want to do a PR?