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



LogTo("tst/mathematica.tst");


# Start

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



IF_Interface(IF_mathematica, "GCD", [1000, 360] );


# Atomic Objects

# String

IF_Interface( IF_mathematica, "Identity", ["ciao"] );
IF_Interface( IF_mathematica, "Identity", ["a\"b\\c"] );


# Integer

l := [-11^90, -1, 0, 1, 10^200];;
List(l, x->IF_Type(IF_mathematica, x));
l=List(l, x-> IF_Interface(IF_mathematica, "Identity", [x]));


# Rational

c:=Enumerator(Rationals);
for i in [1..20] do
  if not c[i]=IF_Interface(IF_mathematica, "Identity", [c[i]] ) then
    Print( c[i], " ", fail, "\n");
  fi;
od;
IF_Interface(IF_mathematica, "Identity", [-10^300/3]) = -10^300/3;


# Complex

IF_Interface(IF_mathematica, "Identity", [E(4)] );
IF_Interface(IF_mathematica, "Identity", [3/5+7/11*E(4)] );

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


# Non-atomic Objects

# List

IF_Interface(IF_mathematica, "Identity", [[11,22,33]]);
IF_Interface(IF_mathematica, "Length", [[11,22,33]]);
IF_Interface(IF_mathematica, "Reverse", [[11,22,33]]);


# end of test file

STOP_TEST( "test", 10000 );

LogTo();
quit;

