On Sunday 23 January 2011 00:47:13 bearophile wrote:
spir:
How to write a predicate like:
assert( throws(someStatement, ErrorType) );
Are you using Design By Contract a lot? Contracts need to contain asserts
only...
Not necessarily. In fact, in general, the tact that has been taken
On 01/23/2011 09:47 AM, bearophile wrote:
spir:
How to write a predicate like:
assert( throws(someStatement, ErrorType) );
Are you using Design By Contract a lot? Contracts need to contain asserts
only...
Bye,
bearophile
No, not yet. I don't see your point.
Denis
that spir is looking for.
Thank all for your answers. Seems I'll have to wait a bit.
Pointer to the current code?
(I'm very curious of how assertThrown works, actually asked about
throws(statement, ErrorType) because I have no idea how to craft it myself.
Seems to me needs compiler support to pass
be in the next release.
assertThrown is the current name of the function that spir is looking
for.
Thank all for your answers. Seems I'll have to wait a bit.
Pointer to the current code?
(I'm very curious of how assertThrown works, actually asked about
throws(statement, ErrorType) because I
and then, then it'll be in the next release.
assertThrown is the current name of the function that spir is looking
for.
Thank all for your answers. Seems I'll have to wait a bit.
Pointer to the current code?
(I'm very curious of how assertThrown works, actually asked about
throws(statement
and then, then it'll be in the next release.
assertThrown is the current name of the function that spir is looking
for.
Thank all for your answers. Seems I'll have to wait a bit.
Pointer to the current code?
(I'm very curious of how assertThrown works, actually asked about
throws(statement
very curious of how assertThrown works, actually asked about
throws(statement, ErrorType) because I have no idea how to craft it
myself. Seems to me needs compiler support to pass around the
statement. Please, do not tell me it uses string mixins ;-)
It uses lazy, not string mixins
Jonathan M Davis:
Not necessarily. In fact, in general, the tact that has been taken with Phobos
is that you use assertions when you're verifying that Phobos is correct, and
you use enforce (or an if-statement which throws an exception) when verifying
that arguments given by outside code is
On Sunday 23 January 2011 09:24:25 bearophile wrote:
Jonathan M Davis:
Not necessarily. In fact, in general, the tact that has been taken with
Phobos is that you use assertions when you're verifying that Phobos is
correct, and you use enforce (or an if-statement which throws an
exception)
How to write a predicate like:
assert( throws(someStatement, ErrorType) );
?
Meaning a kind of builtin shortcut for:
try:
someStatement;
throw new SomeCustomError();
catch (ErrorType _) {}
that would also have the advantage of beeing usable as
It's in that new std.unittest module that's coming in the next
release. At least I think so, it was supposed to come with
std.datetime, and that's scheduled for the next release.
*There are several of those, like assertExcThrown, etc. Try searching
the newsgroups for std.unittest or std.datetime and there should be a
link to the source if you want it right now.
On Saturday 22 January 2011 20:45:14 Andrej Mitrovic wrote:
*There are several of those, like assertExcThrown, etc. Try searching
the newsgroups for std.unittest or std.datetime and there should be a
link to the source if you want it right now.
It's currently being reviewed and eventually vote
13 matches
Mail list logo