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

def test_slicing(self):

    f = fits.open(self.data('table.fits'))
    data = f[1].data
    targets = data.field('target')
    s = data[:]
    assert (s.field('target') == targets).all()
    for n in range((len(targets) + 2)):
        s = data[:n]
        assert (s.field('target') == targets[:n]).all()
        s = data[n:]
        assert (s.field('target') == targets[n:]).all()
    s = data[::2]
    assert (s.field('target') == targets[::2]).all()
    s = data[::(-1)]
    assert (s.field('target') == targets[::(-1)]).all()
