------------------------->  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@tiramisu.ICSI.Berkeley.EDU>

class LIST_TEST is
   include TEST;
   
   main is
      class_name("LIST");
      e ::= LIST{INT}::create(|5,2,1,4|);
      test("copy",e,e.copy);
      test("size",e.size,4);
      e.append(12);
      r1: ARRAY{INT} := |5,2,1,4,12|;
      test("append",e.str,r1.str);
      ra:ARRAY{INT} := |3,-1,2|;
      e.append_all(ra);
      r2: ARRAY{INT} := |5,2,1,4,12,3,-1,2|;
      test("apend_elts",e,r2.str);
      f: LIST{INT} := LIST{INT}::create_sized(4);
      test("size",f.size,4);
      f[1] := 3;
      f.resize(15);
      test("resize",f.size,15);
      test("aget",f[1],3);
      f[12] := 13;
      test("aget",f[12],13);
      f.remove_index(10);
      test("remove_index",f.size,14);
      test("aget remove",f[11],13);
      finish;
   end;
   
end;
-------------------------------------------------------------------



