Beispiel #1
0
 def test_roll_works(self):
     push(42)
     push(40)
     push(38)
     roll(2, 1)
     self.assertEqual(40, pop())
     self.assertEqual(38, pop())
     self.assertEqual(42, pop())
     self.assertRaises(IndexError, pop)
Beispiel #2
0
 def test_roll_works(self):
     push(42)
     push(40)
     push(38)
     roll(2, 1)
     self.assertEqual(40, pop())
     self.assertEqual(38, pop())
     self.assertEqual(42, pop())
     self.assertRaises(IndexError, pop)
Beispiel #3
0
 def test_roll_works_for_larger_stacks(self):
     for i in range(10):
         push(i)
     roll(5, 3)
     self.assertEqual(6, pop())
Beispiel #4
0
 def test_roll_works_for_larger_stacks(self):
     for i in range(10):
         push(i)
     roll(5, 3)
     self.assertEqual(6, pop())