'Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/204'

def test_diff_nans(self):

    arr = np.empty((10, 10), dtype=np.float64)
    arr[:5] = 1.0
    arr[5:] = np.nan
    arr2 = arr.copy()
    table = np.rec.array([(1.0, 2.0), (3.0, np.nan), (np.nan, np.nan)], names=['cola', 'colb']).view(fits.FITS_rec)
    table2 = table.copy()
    assert ImageDataDiff(arr, arr2).identical
    assert TableDataDiff(table, table2).identical
    arr2[0][0] = 2.0
    arr2[5][0] = 2.0
    table2[0][0] = 2.0
    table2[1][1] = 2.0
    diff = ImageDataDiff(arr, arr2)
    assert (not diff.identical)
    assert (diff.diff_pixels[0] == ((0, 0), (1.0, 2.0)))
    assert (diff.diff_pixels[1][0] == (5, 0))
    assert np.isnan(diff.diff_pixels[1][1][0])
    assert (diff.diff_pixels[1][1][1] == 2.0)
    diff = TableDataDiff(table, table2)
    assert (not diff.identical)
    assert (diff.diff_values[0] == (('cola', 0), (1.0, 2.0)))
    assert (diff.diff_values[1][0] == ('colb', 1))
    assert np.isnan(diff.diff_values[1][1][0])
    assert (diff.diff_values[1][1][1] == 2.0)
