Dear Maxima list,
I'm developing some automatic tests of code I'm writing, but I have
come across the folloing problem. This is a minimal example.
My code requires
simp:false.
I define the single function
s(a,b) := ev(gcd(a,b),simp)$
Then create a file rtest_s.mac containing
s(x^2-1,x^3-1);
x-1$
When I run this with
batch("rtest_s.mac",test);
I get the output
********************** Problem 1 ***************
Input:
s(x^2-1,x^3-1)
Result:
x-1
This differed from the expected result:
x-1
0/1 tests passed
The following 1 problem failed: (1)
************************************************
I'm sure this is because internally the result of the function is given by
((MPLUS SIMP) -1 $X)
whereas "x-1" is represented by
((MPLUS) $X ((MMINUS) 1))
So, they are really different, despite the slightly confusing message
above!
What is the best approach to using the automatic testing with simp:false?
Thanks
Chris