Thread overview |
---|
September 03, 2005 unittest and assert | ||||
---|---|---|---|---|
| ||||
Is it true that the first assert that fails breaks the execution? That's not a nice thing. Unittest run should report all succeeding and failing cases in one run! Also, assert badly needs a message (to write when assert fails) part. Assert should report module,class,method not only the line number. And for me, a bit strange that unittests will run on first execution. Should be a different run. (If I am making a lib, do I have to make an executable out of it to unittest it?) ElfQT |
September 03, 2005 Re: unittest and assert | ||||
---|---|---|---|---|
| ||||
Posted in reply to ElfQT | > Unittest run should report all succeeding and failing cases in one run!
>
> Also, assert badly needs a message (to write when assert fails) part. Assert should report module,class,method not only the line number.
Well, I figured it out that I can implement these on my own with a custom
unittest class.
(Using writefln, __FILE__, __LINE__)
ElfQT
|
September 03, 2005 Re: unittest and assert | ||||
---|---|---|---|---|
| ||||
Posted in reply to ElfQT | > Well, I figured it out that I can implement these on my own with a custom > unittest class. > (Using writefln, __FILE__, __LINE__) OK, or maybe not that nice, because I only can include __FILE__ and __LINE__ at every single assert call, and not in the class doing the reporting... (Since no #define or such. Should a mixin help?) |
September 03, 2005 Re: unittest and assert | ||||
---|---|---|---|---|
| ||||
Posted in reply to ElfQT | > Also, assert badly needs a message (to write when assert fails) part. Assert should report module,class,method not only the line number. As I begun to think about it, with the "nunit" unit testing framework (for c# implementation) the AssertEquals(<ValueofVariable>, <ExpectedValue>, <message>) format become the standard, because then the framework is able to report the value of the variable failing and the expected value. ElfQT |
September 04, 2005 Re: unittest and assert | ||||
---|---|---|---|---|
| ||||
Posted in reply to ElfQT | > Unittest run should report all succeeding and failing cases in one run! Yea I agree , I think most people do. > And for me, a bit strange that unittests will run on first execution. Should > be a different run. Yea , built in unit tests seem a good idea, but there are serious limitations to the existing ones , I think most people will just build their own framework. Charlie "ElfQT" <dethjunk@yahoo.com> wrote in message news:dfd0li$kql$1@digitaldaemon.com... > Is it true that the first assert that fails breaks the execution? That's not a nice thing. > > Unittest run should report all succeeding and failing cases in one run! > > Also, assert badly needs a message (to write when assert fails) part. Assert should report module,class,method not only the line number. > > And for me, a bit strange that unittests will run on first execution. Should > be a different run. > (If I am making a lib, do I have to make an executable out of it to unittest > it?) > > ElfQT > > |
Copyright © 1999-2021 by the D Language Foundation