//stack_test.cpp
//EE 312
//tests a very simple cursor based Stack ADT

#include <iostream>
#include "stack_312_LL.h"

using namespace std;

template <typename itemType>
void showStack(const Stack_312 <itemType> & myStack);

int main () {
    
cout << "hello" << endl;
   
   Stack_312<int> myStack;

   Stack_312<string> stack2;

   stack2.push("ehy");
   stack2.push("hello");
   showStack(stack2);
   
   
   myStack.push(42);
  
   myStack.push(52);
 
   myStack.push(12);
   
   cout << "test pushes" << endl;  
   showStack(myStack);

 
   Stack_312 <int> myStack2 = myStack; //copy constructor
  
   myStack.pop();
   
   myStack.pop();
   
   cout << "test pops" << endl;  
   showStack(myStack);
   
   cout << "show other Stack, test copy constructor" << endl;
   showStack(myStack2);
 
}   


//prints Stack.
//note that the cursor is at the EOL when finished
template <typename itemType>
void showStack(const Stack_312 <itemType> & myStack) {

   Stack_312 <itemType> temp = myStack;

   cout << endl;
   cout << "stack from top " << endl;
   while (!temp.isEmpty()) {
      cout << temp.pop() << endl;
   }
   
}