#include <stream.h>
#include <List.h>

class TestObject : public Listable {
public:
  virtual char* classname() { return "TestObject"; }
  virtual IOstatus readContents()  { cin  >> a_; return ok; }
  virtual IOstatus writeContents() { cout << a_; return ok; }
  virtual Listable* duplicate() { return new TestObject(*this); }
private:
  char a_;
};

void testDelete()
{
  cerr << "Testing removal of list elements\n";

  List a(new TestObject);

  a.read();
  delete a.head()->next()->next();
  a.write();
}
