Difference between revisions of "AssertEqualsExact"

From ApCoCoAWiki
(New page: <command> <title>AssertEqualsExact</title> <short_description>Checks if two values are exactly the same.</short_description> <syntax> $apcocoa/ts/assert.AssertEqualsExact(Result: TYPE, Exp...)
 
 
(5 intermediate revisions by the same user not shown)
Line 7: Line 7:
  
 
<description>
 
<description>
This function checks if the two values 'Result' and 'Expected' are exactly the same. If not it throws an error and prints the errors message.
+
This function checks if the two values 'Result' and 'Expected' are <em>exactly</em> the same. If not it throws an error and prints the error message 'ErrMsg'.
  
 
<itemize>
 
<itemize>
<item>@param <em>Condition</em>: Boolean value of a condition</item>
+
<item>@param <em>Result</em>: The result of a computation</item>
 +
<item>@param <em>Expected</em>: The expected value of a computation</item>
 
<item>@param <em>ErrMsg</em>: Error message</item>
 
<item>@param <em>ErrMsg</em>: Error message</item>
 
</itemize>
 
</itemize>
  
 
<example>
 
<example>
 +
Use Q[x];
 
F:=x^2+x+1;
 
F:=x^2+x+1;
 
G:=x-1;
 
G:=x-1;
$apcocoa/ts/assert.AssertTrue(F,G, "F does not equal G.");
+
$apcocoa/ts/assert.AssertTrue(F,G, "Polynomial F does not equal polynomial G.");
 
</example>
 
</example>
  

Latest revision as of 17:31, 22 June 2010

AssertEqualsExact

Checks if two values are exactly the same.

Syntax

$apcocoa/ts/assert.AssertEqualsExact(Result: TYPE, Expected: TYPE, ErrMsg: STRING)

Description

This function checks if the two values 'Result' and 'Expected' are exactly the same. If not it throws an error and prints the error message 'ErrMsg'.

  • @param Result: The result of a computation

  • @param Expected: The expected value of a computation

  • @param ErrMsg: Error message

Example

Use Q[x];
F:=x^2+x+1;
G:=x-1;
$apcocoa/ts/assert.AssertTrue(F,G, "Polynomial F does not equal polynomial G.");