def test_cons_slicing():
 cons = HyCons('car', 'cdr')
 assert (cons[0] == 'car')
 assert (cons[1:] == 'cdr')
 try:
  cons[:]
  assert (True is False)
 except IndexError:
  pass
 try:
  cons[1]
  assert (True is False)
 except IndexError:
  pass

def test_cons_slicing ( ) : cons = HyCons ( 'car' , 'cdr' ) assert ( cons [ 0 ] == 'car' ) assert ( cons [ 1 : ] == 'cdr' ) try : cons [ : ] assert ( True is False ) except IndexError : pass try : cons [ 1 ] assert ( True is False ) except IndexError : pass
check that cons slicing works as expected .