go-sqlmock
go-sqlmock copied to clipboard
Test failing as there are some extra spaces, can i do anything about it?
trafficstars
I have a test with:
mock.ExpectExec(`UPDATE public.project_member SET ("order", updated_at) = ($1, $2) WHERE ((project_member.project_id = $3::varchar(20)) AND (project_member.user_id = $4::varchar(20)));`).
and it's failing as the actual query is:
UPDATE public.project_member SET ("order", updated_at) = ($1, $2) WHERE ( (project_member.project_id = $3::varchar(20)) AND (project_member.user_id = $4::varchar(20)) );
Which is the same except a couple of spaces which shouldn't effect anything.
I have tried with sqlmock.New() and sqlmock.New(sqlmock.QueryMatcherOption(sqlmock.QueryMatcherEqual)).
Is there something i can do other than add spaces to the expected SQL? Im using a SQL generator so can't change the query run.
Thanks!