# this is the source of the test file. The test file is produced by:
# gap4r4 init.g ../if_local < tst/mupad.src # on Medicis
# gap_dev init.g < tst/mupad.src # on my pc
# remove the line 'gap> LogTo();' at the end of the generated file.



LogTo("tst/mupad.tst");


# Start

START_TEST( "Test of the 'if' package" );
SizeScreen([80]);;


IF_Interface(IF_mupad, "gcd", [1000, 360] );
IF_Interface(IF_mupad, "combinat::partitions::list", [4]);
IF_Interface(IF_mupad, "combinat::tableaux::list", [[4,2]]);


# DOM_BOOL

IF_Interface(IF_mupad, "", [true] );


# DOM_FAIL

IF_Interface(IF_mupad, "", [fail] );


# DOM_INT

l := [-3^30, -1, 0, 1, 3^70];;
List(l, x->IF_Type(IF_mupad, x));
l=List(l, x-> IF_Interface(IF_mupad, "", [x]));


# DOM_RAT

c:=Enumerator(Rationals);
for i in [1..20] do
  if not c[i]=IF_Interface(IF_mupad, "", [c[i]] ) then
    Print( c[i], " ", fail, "\n");
  fi;
od;


# DOM_STRING

l := Difference([0..255], IF_PROHIBITED_CHARS[IF_mupad]);;
l1:= List( l{[1..110]}, CHAR_INT);;
l2:= List( l{[110..Length(l)]}, CHAR_INT);;
for i in [l1,l2] do
    ConvertToStringRep( i );
    if not i=IF_Interface(IF_mupad, "", [i]) then
        Print( "different strings!\n" );
    fi;
od;


# DOM_COMPLEX

Print( "imaginary unit ", IF_Interface(IF_mupad, "", [E(4)] ), "\n" );
c:=Enumerator(GaussianRationals);
for i in [1..50] do
  if not c[i]=IF_Interface(IF_mupad, "", [c[i]] ) then
    Print( i, " ", c[i], " ", fail, "\n");
  fi;
od;


# DOM_LIST

l:=[ [ 2 .. 5 ], 53, "ciao", [ 1, 2, 4 ], 33/4 ];;
l=IF_Interface(IF_mupad, "", [l] );
[]=IF_Interface(IF_mupad, "", [[]]); # empty list


# DOM_SET

Set(IF_Interface(IF_mupad, "", "{11,22,33}")) = [ 11, 22, 33 ];


# end of test file

STOP_TEST( "test", 10000 );

LogTo();
quit;
