Trip Volpe:
> Ah ha! I din't know that D had __LINE__ and __FILE__. I thought those had
> been done away with along with the preprocessor. It looks like they're a lot
> smarter than in C as well, since this works just fine:
>
> test.d:
> 1 void main() {
> 2 printlocation();// prints "
Pelle MÃ¥nsson Wrote:
>
> An assertion handler should be created for use in unittests. Preferably
> with colorized output. :)
>
> I stole and changed slightly from std.contracts.enforce (untested)
>
> T test(T, string file=__FILE__, int line=__LINE__)
> (T value, string message="T
"Trip Volpe" wrote in message
news:hk583n$28e...@digitalmars.com...
> Nick Sabalausky Wrote:
>> The deferAssert module (possible name change and other API improvements
>> pending) of my SemiTwist D Tools library (
>> http://www.dsource.org/projects/semitwist ) is designed to get around
>> those
Nick Sabalausky Wrote:
> The deferAssert module (possible name change and other API improvements
> pending) of my SemiTwist D Tools library (
> http://www.dsource.org/projects/semitwist ) is designed to get around those
> problems.
Good to know I'm not the only one who's had to working around
Lutger Wrote:
>
> You can use line and file info with default arguments, this works
> (special case). I just hack around the default unittest system,
> something like this:
>
> void test(string testName)(void delegate () testClosure,
> int line = __LINE__,
>
On 01/31/2010 09:39 PM, Trip Volpe wrote:
I recently began porting an existing C++ project of mine (a
compiler/interpreter for a dynamic language) to D. In the process I found that
the built-in unit testing support, while an awesome concept, was a little bit
sparse. In particular, assert() is
On 01/31/2010 10:04 PM, Nick Sabalausky wrote:
"Lutger" wrote in message
news:hk4r35$1hp...@digitalmars.com...
You can use line and file info with default arguments, this works (special
case).
That must be a D2 thing, because I know it doesn't work in D1.
Indeed, here is the change:
htt
"Lutger" wrote in message
news:hk4r35$1hp...@digitalmars.com...
>
> You can use line and file info with default arguments, this works (special
> case).
That must be a D2 thing, because I know it doesn't work in D1.
On 01/31/2010 09:39 PM, Trip Volpe wrote:
I recently began porting an existing C++ project of mine (a
compiler/interpreter for a dynamic language) to D. In the process I found that
the built-in unit testing support, while an awesome concept, was a little bit
sparse. In particular, assert() is
"Trip Volpe" wrote in message
news:hk4pql$1eh...@digitalmars.com...
>I recently began porting an existing C++ project of mine (a
>compiler/interpreter for a dynamic language) to D. In the process I found
>that the built-in unit testing support, while an awesome concept, was a
>little bit spars
I recently began porting an existing C++ project of mine (a
compiler/interpreter for a dynamic language) to D. In the process I found that
the built-in unit testing support, while an awesome concept, was a little bit
sparse. In particular, assert() is fairly useless for unit tests, since it
thr
11 matches
Mail list logo