dshould.basic

Undocumented in source.

Members

Functions

approximately
auto approximately(Should should)
Undocumented in source. Be warned that the author may not have intended to support it.
approximately
auto approximately(Should should, double expected, ErrorValue error, Fence _, string file, size_t line)

.approximately is a word indicating an approximate value comparison. When using .approximately, only the words .be and .equal may be used, though they may appear before or after. Each must be called with an additional parameter, error = <float>, indicating the amount of permissible error.

be
void be(Should should, T expected, Fence _, string file, size_t line)

The word .be indicates a test for identity. For value types, this is equivalent to equality. It takes one parameter and terminates the phrase.

be
auto be(Should should)

When called without parameters, .be is a filler word for .greater, .less or .equal.

be
void be(Should should, T expected, ErrorValue error, Fence _, string file, size_t line)
Undocumented in source. Be warned that the author may not have intended to support it.
equal
void equal(Should should, T expected, Fence _, string file, size_t line)

The word .equal tests for equality. It takes one parameter and terminates the phrase. Its parameter is the expected value for the left-hand side of the should phrase.

equal
auto equal(Should should)

When called without parameters, .equal must be terminated by .greater or .less. .should.be.equal.greater(...) is equivalent to .should.be.greater.equal(...) is equivalent to assert(got >= expected).

equal
void equal(Should should, T expected, ErrorValue error, Fence _, string file, size_t line)
Undocumented in source. Be warned that the author may not have intended to support it.
error
auto error(double value)
Undocumented in source. Be warned that the author may not have intended to support it.
greater
void greater(Should should, T expected, Fence _, string file, size_t line)

The word .greater tests that the left-hand side is greater than the expected value. It takes one parameter and terminates the phrase.

greater
auto greater(Should should)

When called without parameters, .greater must be terminated by .equal, indicating >=.

less
void less(Should should, T expected, Fence _, string file, size_t line)

The word .less tests that the left-hand side is less than the expected value. It takes one parameter and terminates the phrase.

less
auto less(Should should)

When called without parameters, .less must be terminated by .equal, indicating <=.

not
auto not(Should should)

The word .not negates the current phrase.

should (from dshould.ShouldType)
auto should(T got) via public import dshould.ShouldType : should;

.should begins every fluent assertion in dshould. It takes no parameters on its own. Note that leaving a .should phrase unfinished will error at runtime.

Meta