------------------------->  GNU Sather - sourcefile  <-------------------------
-- Copyright (C) 1995 by International Computer Science Institute            --
-- This file is part of the GNU Sather library. It is free software; you may --
-- redistribute  and/or modify it under the terms of the GNU Library General --
-- Public  License (LGPL)  as published  by the  Free  Software  Foundation; --
-- either version 2 of the license, or (at your option) any later version.   --
-- This  library  is distributed  in the  hope that it will  be  useful, but --
-- WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See Doc/LGPL for more details.       --
-- The license text is also available from:  Free Software Foundation, Inc., --
-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                     --
-------------->  Please email comments to <bug-sather@gnu.org>  <--------------

-- Author: Benedict A. Gomes <gomes@samosa.ICSI.Berkeley.EDU>

class QUEUE_TEST is
   include TEST;
   
   main is
      class_name("QUEUE");
      q: A_QUEUE{STR} := #A_QUEUE{STR};
      test("is_empty",q.is_empty.str,true.str);
      q.enq("a");
      test("is_empty",q.is_empty.str,false.str);
      test("top",q.top,"a");
      test("remove 1",q.remove,"a");
      q.enq("b");
      q.enq("c");
      q.enq("d");
      q.enq("e");
      q.enq("f");
      test("size",q.size.str,5.str);
      test("remove 2",q.remove,"b");
      test("remove 3",q.remove,"c");
      test("remove 4",q.remove,"d");
      test("remove 5",q.remove,"e");
      test("is_empty",q.is_empty.str,false.str);
      test("remove 6",q.remove,"f");
      test("size",q.size.str,0.str);
      test("is_empty",q.is_empty.str,true.str);
      q.enq("a");
      q.enq("b");
      q.enq("c");
      q.enq("d");
      q.enq("e");
      q.enq("f");
      q.enq("1a");
      q.enq("1b");
      q.enq("1c");
      q.enq("1d");
      q.enq("1e");
      q.enq("1f");
      test("size",q.size.str,12.str);
      test("remove",q.remove,"a");
      test("remove",q.remove,"b");
      test("remove",q.remove,"c");
      m ::= #QUEUE{INT};
      test("is_empty",m.is_empty,true);
       finish;
   end;
end;

-------------------------------------------------------------------
