aboutsummaryrefslogtreecommitdiffstats
path: root/docs/Reference/LuaUnitAssertionFunctions/5_TypeAssertions.md
blob: 843f65177b02aac7d2878867a916a77c89a95643 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Type assertions

The following functions all perform type checking on their argument. If the
received value is not of the right type, the failure message will contain the
expected type, the received type and the received value to help you identify
better the problem.

* **_AFT.assertIsNumber(value)**

    Assert that the argument is a number (integer or float)

* **_AFT.assertIsString(value)**

    Assert that the argument is a string.

* **_AFT.assertIsTable(value)**

    Assert that the argument is a table.

* **_AFT.assertIsBoolean(value)**

    Assert that the argument is a boolean.

* **_AFT.assertIsFunction(value)**

    Assert that the argument is a function.

* **_AFT.assertIsUserdata(value)**

    Assert that the argument is a userdata.

* **_AFT.assertIsThread(value)**

    Assert that the argument is a coroutine (an object with type thread ).

* **_AFT.assertNotIsThread(value)**

    Assert that the argument is a not coroutine (an object with type thread ).