diff options
author | Corentin Le Gall <corentinlgs@gmail.com> | 2018-07-19 15:57:30 +0200 |
---|---|---|
committer | Corentin Le Gall <corentinlgs@gmail.com> | 2018-07-24 14:42:12 +0200 |
commit | c96df58a88b60c7501b3c8a758c0277c17088371 (patch) | |
tree | 1e982c565a4fd0ba65a382cc1cba97efe891c34b /docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/0_GeneralAssertions.md | |
parent | 55673d50338f041763e6e38f38ea3fc311f2bdc1 (diff) |
Changed doc to GitBook format + added doc
-Changed README.md to a complet GitBook doc.
-Added explanations about EvtGrpReceived functions.
-Corrected mistakes + reduced lines length.
Change-Id: I1a077ddf6acb520a9158de658d3c09b12a2029d4
Signed-off-by: Corentin Le Gall <corentinlgs@gmail.com>
Diffstat (limited to 'docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/0_GeneralAssertions.md')
-rw-r--r-- | docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/0_GeneralAssertions.md | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/0_GeneralAssertions.md b/docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/0_GeneralAssertions.md new file mode 100644 index 0000000..4a719b6 --- /dev/null +++ b/docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/0_GeneralAssertions.md @@ -0,0 +1,32 @@ +# General Assertions + +* **_AFT.assertEquals(actual, expected)** + + Assert that two values are equal. + + For tables, the comparison is a deep comparison : + + * number of elements must be the same + * tables must contain the same keys + * each key must contain the same values. The values are also compared recursively with deep comparison. + + LuaUnit provides other table-related assertions, see [Table assertions](http://luaunit.readthedocs.io/en/luaunit_v3_2_1/#assert-table) + +* **_AFT.assertNotEquals(actual, expected)** + + Assert that two values are different. The assertion fails if the two values are identical. + + It also uses table deep comparison. + +* **_AFT.assertAlmostEquals(actual, expected, margin)** + + Assert that two floating point numbers are almost equal. + + When comparing floating point numbers, strict equality does not work. + Computer arithmetic is so that an operation that mathematically yields + 1.00000000 might yield 0.999999999999 in lua . That’s why you need an + almost equals comparison, where you specify the error margin. + +* **_AFT.assertNotAlmostEquals(actual, expected, margin)** + + Assert that two floating point numbers are not almost equal.
\ No newline at end of file |