random k-sample of a file

Christopher Wright dhasenan at gmail.com
Fri Oct 10 05:12:06 PDT 2008


Andrei Alexandrescu wrote:
>     enforce(k > 0, "Must pass a strictly positive selection size");

Out of curiosity, why are you using enforce rather than assert?

I've written an assertions framework, but it provides some more options 
than assert:

expect.because ("Must pass a strictly positive selection size").that 
(k).greaterThan (0);

If that failed, it would produce:
AssertionException: Expected: greater than 0 but was: -4 -- Must pass a 
strictly positive selection size



More information about the Digitalmars-d mailing list