mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 16:27:02 +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:
|
def stack_is_valid(self) -> bool:
|
||||||
"""
|
"""
|
||||||
Validate stack is not empty
|
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:
|
if len(self.stack) == 0:
|
||||||
print("Stack is empty")
|
print("Stack is empty")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user