'Test the slice() constructor in nopython mode.'

def test_slice_constructor(self):

    maxposint = sys.maxsize
    maxnegint = ((- maxposint) - 1)
    cfunc = jit(nopython=True)(slice_constructor)
    for (args, expected) in [((), (0, maxposint, 1)), ((None, None), (0, maxposint, 1)), ((1, None), (1, maxposint, 1)), ((None, 2), (0, 2, 1)), ((1, 2), (1, 2, 1)), ((None, None, 3), (0, maxposint, 3)), ((None, 2, 3), (0, 2, 3)), ((1, None, 3), (1, maxposint, 3)), ((1, 2, 3), (1, 2, 3)), ((None, None, (-1)), (maxposint, maxnegint, (-1))), ((10, None, (-1)), (10, maxnegint, (-1))), ((None, 5, (-1)), (maxposint, 5, (-1))), ((10, 5, (-1)), (10, 5, (-1)))]:
        got = cfunc(*args)
        self.assertPreciseEqual(got, expected)
