def testBackward(self): ca = CircularArray(list(range(0, 5))) self.assertEqual(ca.backward(), 4) self.assertEqual(ca.backward(), 3) self.assertEqual(ca.backward(), 2) self.assertEqual(ca.backward(), 1) self.assertEqual(ca.backward(), 0) self.assertEqual(ca.backward(), 4)
def xtestBidirectionality(self): ca = CircularArray(list(range(0, 5))) self.assertEqual(ca.backward(), 4) self.assertEqual(ca.forward(), 0) self.assertEqual(ca.backward(), 4) self.assertEqual(ca.forward(), 0) self.assertEqual(ca.forward(), 1) self.assertEqual(ca.forward(), 2) self.assertEqual(ca.forward(), 3) self.assertEqual(ca.forward(), 4) self.assertEqual(ca.backward(), 3) self.assertEqual(ca.backward(), 2) self.assertEqual(ca.backward(), 1) self.assertEqual(ca.backward(), 0)