Skip to content

Test failing as there are some extra spaces, can i do anything about it? #349

@Jleagle

Description

@Jleagle

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions