コード例 #1
0
 def test_dupicate_nonempty(self):
     stack = Stack([True])
     stack.dup()
     assert len(stack) is 2 and stack[-1]
コード例 #2
0
 def test_stack_opper_dup_add(self):
     stack = Stack()
     stack.append(1)
     stack.dup()
     stack.math.add()
     assert len(stack) is 1 and stack[-1] is 2
コード例 #3
0
 def test_duplicate_empty(self):
     stack = Stack()
     stack.dup()
     assert stack.isempty() is True