Test a function: Difference between revisions

Content added Content deleted
Line 504: Line 504:
=={{header|Mathematica}}==
=={{header|Mathematica}}==
<lang Mathematica>myFun[x_] := Block[{y},y = x^2; Assert[y > 5]; Sin[y]]
<lang Mathematica>myFun[x_] := Block[{y},y = x^2; Assert[y > 5]; Sin[y]]
On[Assert];myFun[1.0]
On[Assert];myFun[1.0]</lang>


Output:
->Assert::asrtf: Assertion y>5 failed.
->0.841471</lang>


<pre>Assert::asrtf: Assertion y>5 failed.
0.841471</pre>


=={{header|NetRexx}}==
=={{header|NetRexx}}==