mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 08:17:01 +00:00
Adding more tests
This commit is contained in:
parent
5f31db7884
commit
81821b3583
|
@ -152,6 +152,15 @@ class MinMaxStack:
|
|||
def stack_is_valid(self) -> bool:
|
||||
"""
|
||||
Validate stack is not empty
|
||||
|
||||
>>> test_stack = MinMaxStack(3)
|
||||
>>> test_stack.stack_is_valid()
|
||||
Stack is empty
|
||||
False
|
||||
>>> test_stack.push_value(0)
|
||||
True
|
||||
>>> test_stack.stack_is_valid()
|
||||
True
|
||||
"""
|
||||
if len(self.stack) == 0:
|
||||
print("Stack is empty")
|
||||
|
|
Loading…
Reference in New Issue
Block a user