Description Expression Value
Empty Stack
Create an empty stack (stack1). Confirm that it is empty then attempt to pop from the empty stack. Check for ‘pop from an empty stack’ exception.

stack stack1
stack1.is_empty()
stack1.pop()
	


true
stack::empty_pop 
exception thrown
	 
	
Push/pop
Create an empty stack (stack1) and push 3 different values. Check that the stack is not empty. Pop the data, checking the numbers returned, and then confirm that it is empty. Check for exceptions.

stack stack1
stack1.push() (three times)
stack1.is_empty()
stack1.pop() (three times)
stack1.is_empty()
	


x, y, z
false
z, y, x
true
no exceptions