/*
testIntSets.cc  -- Program to test IntSets

Author: Larry Morell

Modification History
Date        Action
03/13/06  -- Original version

*/
using namespace std;
#include <iostream>
#include <string>
#include "IntSets.h"
using namespace std;

int main () {
  IntSet ES;
  ES.displayln();

  // Adding characters
  IntSet t("abcdefghi");
  cout << "Testing initiialization with string 'abcdefghi'" << endl;
  t.displayln();
  cout << "Testing initiialization with char 'a'" << endl;
  IntSet x('a');
  x.displayln();
  cout << "Adding 'x'" << endl;
  x =( x + 'x'); 
  x.displayln();
  cout << "Adding 'y'" << endl;
  x =( x + 'y'); 
  x.displayln();
  IntSet y(x);
  x = x + 'z';
  x.displayln();
  y.displayln();
  x = x - y;
  cout << "Set containing only z: " << endl;
  x.displayln();
  x = (x + 'y');
  x.displayln();
  x = (x + 'x');
  cout << "Set containing x,y,z" << endl;
  x.displayln();
  x = x - 'x';
  x.displayln();
  x = x - 'y';
  cout << "Set containing only z: " << endl;
  x.displayln();
  t = t - t;
  for (char ch='a'; ch <= 'z'; ch++) {
     t = t + ch;
     cout << "Alphabet:";
     t.displayln();
  }
  for (char ch='a'; ch <= 'z'; ch++) {
     t = t - ch;
     cout << "Alphabet:";
     t.displayln();
  }
  cout << "------------------" << endl;
  for (char ch=0; ch <= 20; ch++) {
     t = t + ch;
     cout << "Alphabet:";
     t.displayln();
  }

  cout << "Checking for container" << endl;
  if ( t.contains(18))
     cout << "Contain ok!" << endl;
  else
     cout << "Contain NOT ok!" << endl;
  if ( t.contains(38))
     cout << "Contain NOT ok!" << endl;
  else
     cout << "Contain ok!" << endl;
  return 0;
}


