From 32e13cd580c39c17112d13086e3e722aee06b352 Mon Sep 17 00:00:00 2001 From: "Richard Horton (hortonr6)" Date: Fri, 19 Jul 2019 17:21:00 +0100 Subject: [PATCH] Added Tests --- Stacks-Queues.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Stacks-Queues.py b/Stacks-Queues.py index 8ad0f9c..24add0d 100644 --- a/Stacks-Queues.py +++ b/Stacks-Queues.py @@ -30,3 +30,29 @@ class Queue: for item in self.queue: print(item) +print("TEST: STACK\n") + +testStack = Stack() +testStack.push(87) +testStack.push(43) +testStack.push(13) +testStack.push(98) +testStack.push(57) + +testStack.printStack() +print("\nExpected: 57 --- Actual:", testStack.pop()) +print("Expected: 98 --- Actual:", testStack.pop()) +print("\n------------------------------") +print("\nTEST: QUEUE\n") + +testQueue = Queue() +testQueue.push(87) +testQueue.push(43) +testQueue.push(13) +testQueue.push(98) +testQueue.push(57) + +testQueue.printQueue() +print("\nExpected: 87 --- Actual:", testQueue.pop()) +print("Expected: 43 --- Actual:", testQueue.pop()) +