aboutsummaryrefslogtreecommitdiffstats
path: root/docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/1_ValueAssertions.md
diff options
context:
space:
mode:
authorCorentin Le Gall <corentinlgs@gmail.com>2018-07-19 15:57:30 +0200
committerCorentin Le Gall <corentinlgs@gmail.com>2018-07-24 14:42:12 +0200
commitc96df58a88b60c7501b3c8a758c0277c17088371 (patch)
tree1e982c565a4fd0ba65a382cc1cba97efe891c34b /docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/1_ValueAssertions.md
parent55673d50338f041763e6e38f38ea3fc311f2bdc1 (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/1_ValueAssertions.md')
-rw-r--r--docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/1_ValueAssertions.md58
1 files changed, 58 insertions, 0 deletions
diff --git a/docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/1_ValueAssertions.md b/docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/1_ValueAssertions.md
new file mode 100644
index 0000000..ed927cd
--- /dev/null
+++ b/docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/1_ValueAssertions.md
@@ -0,0 +1,58 @@
+# Value assertions
+
+* **_AFT.assertEvalToTrue(value)**
+
+ Assert that a given value evals to true. Lua coercion rules are applied so
+ that values like 0,"",1.17 succeed in this assertion. If provided, extra_msg
+ is a string which will be printed along with the failure message.
+
+* **_AFT.assertEvalToFalse(Value)**
+
+ Assert that a given value eval to *false*. Lua coercion rules are applied so
+ that *nil* and *false* succeed in this assertion. If provided, extra_msg is a
+ string which will be printed along with the failure message.
+
+* **_AFT.assertIsTrue(value)**
+
+ Assert that a given value compares to true. Lua coercion rules are applied so
+ that values like 0, "", 1.17 all compare to true.
+
+* **_AFT.assertIsFalse(value)**
+
+ Assert that a given value compares to false. Lua coercion rules are applied so
+ that only nil and false all compare to false.
+
+* **_AFT.assertIsNil(value)**
+
+ Assert that a given value is nil .
+
+* **_AFT.assertNotIsNil(value)**
+
+ Assert that a given value is not *nil* . Lua coercion rules are applied
+ so that values like ``0``, ``""``, ``false`` all validate the assertion.
+ If provided, *extra_msg* is a string which will be printed along with the
+ failure message.
+
+* **_AFT.assertIs(actual, expected)**
+
+ Assert that two variables are identical. For string, numbers, boolean and
+ for nil, this gives the same result as assertEquals() . For the other types,
+ identity means that the two variables refer to the same object.
+
+ Example :
+
+ ```lua
+ `s1='toto'
+ s2='to'..'to'
+ t1={1,2}
+ t2={1,2}
+ luaunit.assertIs(s1,s1) -- ok
+ luaunit.assertIs(s1,s2) -- ok
+ luaunit.assertIs(t1,t1) -- ok
+ luaunit.assertIs(t1,t2) -- fail`
+ ```
+
+* **_AFT.assertNotIs(actual, expected)**
+
+ Assert that two variables are not identical, in the sense that they do not
+ refer to the same value. See assertIs() for more details. \ No newline at end of file