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

BE_BETWEEN should report better on Type mismatch #1108

Open
pesse opened this issue Nov 12, 2020 · 4 comments
Open

BE_BETWEEN should report better on Type mismatch #1108

pesse opened this issue Nov 12, 2020 · 4 comments
Assignees

Comments

@pesse
Copy link
Member

pesse commented Nov 12, 2020

Describe the bug
Different to all the comparison matchers, BE_BETWEEN does not give away details of a type mismatch in its error message. It would be very helpful to have these details, for example when accidentially comparing timestamp with timestamp with timezone.

Internally, BE_BETWEEN should probably also fail on mismatch of upper and lower bound (this might not happen at the moment, but I would like to have a check in the Matcher itself to make it more error-proof)

Provide version info
Latest utPLSQL version, all databases

Information about client software
Independent from client

To Reproduce

begin
    -- Shows exactly *why* it fails
    ut.expect(to_timestamp(current_timestamp)).to_equal(current_timestamp);
    -- Gives only a generic "cannot be used with" - no indication what kind of datatype the matcher is initialized with
    ut.expect(to_timestamp(current_timestamp)).to_be_between(current_timestamp-interval '5' second, current_timestamp);
end;
/

Message: The matcher 'be between' cannot be used with data type (timestamp).

Expected behavior
Similar description as with the comparison-Matchers, like:
Actual (timestamp with timezone) cannot be compared to Expected (timestamp) using matcher 'be between'.

@pesse
Copy link
Member Author

pesse commented Nov 12, 2020

I would like to implement this myself

@pesse pesse self-assigned this Nov 12, 2020
@lwasylow
Copy link
Member

lwasylow commented Feb 2, 2022

Hi @pesse, you still want to look at that one or you of for me to pick it up ?

@pesse
Copy link
Member Author

pesse commented Feb 3, 2022

Haha, please pick it up. Once I find time and energy to get into the project again, I have loads of stuff to do with cli and java-api

@lwasylow lwasylow self-assigned this Feb 8, 2022
@lwasylow
Copy link
Member

lwasylow commented Feb 8, 2022

So I'm not entirely sure that this is a valid message.
Its produced by ut_matcher in opposite to ut_equal generated by ut_comparision_matcher.
The similar situation we have for to_be_like or have_count.
Unless we want to create customized messages for each of these matchers ?
@jgebal @pesse , what's your thought

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants