Assertion.exist

Asserts whether a value exists - currently simply compares it with null, if it is a pointer, a class or a string. Returns the value wrapped around the assertion.

struct Assertion(T)
@safe
T
exist
(
string file = __FILE__
,
size_t line = __LINE__
)

Examples

auto exists = "I exist!";
should(exists).exist;
string doesntexist;
doesntexist.should.exist; // Throws an Exception "expected null to exist"
Object aObject;
aClass.should.not.exists;

Meta