8000 BE_BETWEEN should report better on Type mismatch · Issue #1108 · utPLSQL/utPLSQL · GitHub
[go: up one dir, main page]

Skip to content
BE_BETWEEN should report better on Type mismatch #1108
Open
@pesse

Description

@pesse

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'.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0