dshould.basic

Undocumented in source.

Public Imports

dshould.ShouldType
public import dshould.ShouldType : should;

Members

Functions

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.

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

The word .be() is a placeholder for .equal.

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

The phrase be(null) is equivalent to be.same.as(null).

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.

quote
string quote(T t)
Undocumented in source. Be warned that the author may not have intended to support it.
same
auto same(Should should)

The phrase be.same.as() compares two values by reference.

Structs

ErrorValue
struct ErrorValue

This could be in a separate file, say approx.d, if doing so didn't crash dmd. see https://issues.dlang.org/show_bug.cgi?id=18839

Meta