Skip to content

Fix test() function so that it can distinguish NA from NaN #2365

Description

@st-pasha

The following simple test currently passes, whereas it should not

require(data.table)
data.table:::test(11111, as.numeric(NA), NaN)

Activity

  1. added this to the milestone on Sep 15, 2017
  2. removed this from the milestone on Sep 16, 2017
  3. mattdowle commented on Sep 16, 2017

    @mattdowle
    Member

    I know this was my suggestion to change test(), but thinking about it, have now just added identical() into the test() calls in this rare case (PR #2363) where we care about NaN/NA differences. Changing test() to no longer use all.equal() (which considers NA and NaN equal) will be too much work for little benefit. Passing identical() to test() when we need that, should be fine.

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

Metadata

Metadata

Assignees

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