The Wayback Machine - https://web.archive.org/web/20201031082439/https://github.com/labstack/echox/issues/140
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

guide testing example FAIL ; actual has additional "\n" symbol in the end of string. #140

Open
likejehu opened this issue Feb 28, 2020 · 1 comment

Comments

@likejehu
Copy link

@likejehu likejehu commented Feb 28, 2020

hey, I'm a beginner, studying golang
testing example produce this result:

Running tool: C:\Go\bin\go.exe test -timeout 30s github.com\likejehu\xpl -run ^(TestCreateUser)$

--- FAIL: TestCreateUser (0.00s)
c:\Users\aart\go\src\github.com\likejehu\xpl\handler_test.go:32:
Error Trace: handler_test.go:32
Error: Not equal:
expected: "{"name":"Jon Snow","email":"jon@labstack.com"}"
actual : "{"name":"Jon Snow","email":"jon@labstack.com"}\n"

    	            	Diff:
    	            	--- Expected
    	            	+++ Actual
    	            	@@ -1 +1,2 @@
    	            	 {"name":"Jon Snow","email":"jon@labstack.com"}
    	            	+
    	Test:       	TestCreateUser

FAIL
FAIL github.com/likejehu/xpl 0.364s
FAIL
Error: Tests failed.

is it okay?

can anyone explain me why we have
"{"name":"Jon Snow","email":"jon@labstack.com"}\n"
this as actual string after calling handler func, whith "\n" at the end?

@s0j0hn
Copy link

@s0j0hn s0j0hn commented May 2, 2020

Same for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.