3 title: Value Assertions
5 https://git.automotivelinux.org/apps/app-afb-test/plain/docs/Reference/LuaUnitAssertionFunctions/1_ValueAssertions.md?h=master
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/app-afb-test-developer-guides-api-services-book.yml -->
12 * **_AFT.assertEvalToTrue(value)**
14 Assert that a given value evals to true. Lua coercion rules are applied so
15 that values like 0,"",1.17 succeed in this assertion. If provided, extra_msg
16 is a string which will be printed along with the failure message.
18 * **_AFT.assertEvalToFalse(Value)**
20 Assert that a given value eval to *false*. Lua coercion rules are applied so
21 that *nil* and *false* succeed in this assertion. If provided, extra_msg is a
22 string which will be printed along with the failure message.
24 * **_AFT.assertIsTrue(value)**
26 Assert that a given value compares to true. Lua coercion rules are applied so
27 that values like 0, "", 1.17 all compare to true.
29 * **_AFT.assertIsFalse(value)**
31 Assert that a given value compares to false. Lua coercion rules are applied so
32 that only nil and false all compare to false.
34 * **_AFT.assertIsNil(value)**
36 Assert that a given value is nil .
38 * **_AFT.assertNotIsNil(value)**
40 Assert that a given value is not *nil* . Lua coercion rules are applied
41 so that values like ``0``, ``""``, ``false`` all validate the assertion.
42 If provided, *extra_msg* is a string which will be printed along with the
45 * **_AFT.assertIs(actual, expected)**
47 Assert that two variables are identical. For string, numbers, boolean and
48 for nil, this gives the same result as assertEquals() . For the other types,
49 identity means that the two variables refer to the same object.
58 luaunit.assertIs(s1,s1) -- ok
59 luaunit.assertIs(s1,s2) -- ok
60 luaunit.assertIs(t1,t1) -- ok
61 luaunit.assertIs(t1,t2) -- fail
64 * **_AFT.assertNotIs(actual, expected)**
66 Assert that two variables are not identical, in the sense that they do not
67 refer to the same value. See assertIs() for more details.