------------------------->  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 BOOL_TEST is
   -- Test of BOOL.
   include TEST;
   
   main is
      -- Test of BOOL.
      class_name("BOOL");
      
      test("false.not", false.not.str, "true");
      test("true.not", true.not.str, "false");
      
      test("false and false", (false and false).str, "false");
      test("false and true", (false and true).str, "false");
      test("true and false", (true and false).str, "false");
      test("true and true", (true and true).str, "true");
      
      test("false or false", (false or false).str, "false");
      test("false or true", (false or true).str, "true");
      test("true or false", (true or false).str, "true");
      test("true or true", (true or true).str, "true");
      
      test("false.xor(false)", (false.xor(false)).str, "false");
      test("false.xor(true)", (false.xor(true)).str, "true");
      test("true.xor(false)", (true.xor(false)).str, "true");
      test("true.xor(true)", (true.xor(true)).str, "false");
      
      test("false.xnor(false)", (false.xnor(false)).str, "true");
      test("false.xnor(true)", (false.xnor(true)).str, "false");
      test("true.xnor(false)", (true.xnor(false)).str, "false");
      test("true.xnor(true)", (true.xnor(true)).str, "true");

      test("false.nand(false)", (false.nand(false)).str, "true");
      test("false.nand(true)", (false.nand(true)).str, "true");
      test("true.nand(false)", (true.nand(false)).str, "true");
      test("true.nand(true)", (true.nand(true)).str, "false");

      test("false.nor(false)", (false.nor(false)).str, "true");
      test("false.nor(true)", (false.nor(true)).str, "false");
      test("true.nor(false)", (true.nor(false)).str, "false");
      test("true.nor(true)", (true.nor(true)).str, "false");

      test("false.implies(false)", (false.implies(false)).str, "true");
      test("false.implies(true)", (false.implies(true)).str, "true");
      test("true.implies(false)", (true.implies(false)).str, "false");
      test("true.implies(true)", (true.implies(true)).str, "true");
      
      test("false.and_rout(false)", false.and_rout(false).str, "false");
      test("false.and_rout(true)", false.and_rout(true).str, "false");
      test("true.and_rout(false)", true.and_rout(false).str, "false");
      test("true.and_rout(true)", true.and_rout(true).str, "true");
      
      test("false.or_rout(false)", false.or_rout(false).str, "false");
      test("false.or_rout(true)", false.or_rout(true).str, "true");
      test("true.or_rout(false)", true.or_rout(false).str, "true");
      test("true.or_rout(true)", true.or_rout(true).str, "true");
      
      test("false.nor_not(false)", false.nor_not(false).str, "false");
      test("false.nor_not(true)", false.nor_not(true).str, "true");
      test("true.nor_not(false)", true.nor_not(false).str, "false");
      test("true.nor_not(true)", true.nor_not(true).str, "false");
      
      test("false.and_not(false)", false.and_not(false).str, "false");
      test("false.and_not(true)", false.and_not(true).str, "false");
      test("true.and_not(false)", true.and_not(false).str, "true");
      test("true.and_not(true)", true.and_not(true).str, "false");

      test("false.nand_not(false)", false.nand_not(false).str, "true");
      test("false.nand_not(true)", false.nand_not(true).str, "true");
      test("true.nand_not(false)", true.nand_not(false).str, "false");
      test("true.nand_not(true)", true.nand_not(true).str, "true");
      
      test("false.or_not(false)", false.or_not(false).str, "true");
      test("false.or_not(true)", false.or_not(true).str, "false");
      test("true.or_not(false)", true.or_not(false).str, "true");
      test("true.or_not(true)", true.or_not(true).str, "true");
      
      test("true.str", true.str, "true");
      test("false.str", false.str, "false");
      
      finish end;

end; 
