Nil and Non-nil Assertions

Check whether a test condition is nil or non-nil.

Topics

Testing if a Condition is nil

Testing if a Condition is Non-nil

func XCTUnwrap<T>(() -> T?, () -> String, file: StaticString, line: UInt) -> T

Asserts that an expression is not nil and returns the unwrapped value.

See Also

Test Assertions

Boolean Assertions

Test a condition that generates a true or false result.

Equality and Inequality Assertions

Check whether two values are equal or unequal.

Comparable Value Assertions

Compare two values to determine whether one is larger or smaller than the other.

Error Assertions

Check whether a function call throws (or does not throw) an error.

Failing Unconditionally

Generate a failure immediately and unconditionally.