Assertions
| Spice |
|---|
| import "std/test/assertions";
|
Functions
assertTrue
| Spice |
|---|
| public inline p assertTrue(bool actual)
|
Assert that the given condition is true
Parameters
| Name |
Type |
Description |
actual |
bool |
Condition to check |
assertFalse
| Spice |
|---|
| public inline p assertFalse(bool actual)
|
Assert that the given condition is false
Parameters
| Name |
Type |
Description |
actual |
bool |
Condition to check |
assertEqual
| Spice |
|---|
| public inline p assertEqual<T>(const T& expected, const T& actual)
|
Assert that two values are equal
Parameters
| Name |
Type |
Description |
expected |
const T& |
Expected value |
actual |
const T& |
Actual value |
assertNotEqual
| Spice |
|---|
| public inline p assertNotEqual<T>(const T& expected, const T& actual)
|
Assert that two values are not equal
Parameters
| Name |
Type |
Description |
expected |
const T& |
Value that is not expected |
actual |
const T& |
Actual value |
assertNil
| Spice |
|---|
| public inline p assertNil<T>(const T& actual)
|
Assert that the given value is nil
Parameters
| Name |
Type |
Description |
actual |
const T& |
Value to check |
assertNotNil
| Spice |
|---|
| public inline p assertNotNil<T>(const T& actual)
|
Assert that the given value is not nil
Parameters
| Name |
Type |
Description |
actual |
const T& |
Value to check |
assertEmpty
| Spice |
|---|
| public inline p assertEmpty(string actual)
|
Assert that the given string is empty
Parameters
| Name |
Type |
Description |
actual |
string |
String to check |
assertNotEmpty
| Spice |
|---|
| public inline p assertNotEmpty(string actual)
|
Assert that the given string is not empty
Parameters
| Name |
Type |
Description |
actual |
string |
String to check |
assertContains
| Spice |
|---|
| public inline p assertContains(string actual, string needle)
|
Assert that the given string contains the given substring
Parameters
| Name |
Type |
Description |
actual |
string |
String to search in |
needle |
string |
Substring that must be contained |