Skip to content

Extend near() and relativelyNear() matchers to REAL64 (and arbitrary rank) #542

@tclune

Description

@tclune

The near(expected, tolerance) and relativelyNear(expected, tolerance) Hamcrest matchers currently lack overloads for REAL64. When used with a REAL64 argument, NAG rejects the call with:

No specific match for reference to generic NEAR

Example that fails to compile:

real(REAL64) :: q_out(16, 11)
@assert_that(q_out, every_item(is(near(7.0_REAL64, 1.e-10_REAL64))))

Request:

Add overloads of near() and relativelyNear() for REAL64, matching what @assertEqual already supports. Ideally the interface would be generic over kind (REAL32/REAL64) and rank.

Workaround:

Use @assertEqual(expected, array, tolerance) which already handles REAL64 and arbitrary ranks.

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