June 07, 2004
What is the correct way to add a unittest for a class.. I did the following:

class MD5 {

	unittest {
		auto MD5 m = new MD5();

		m.reset();
		m.process("");
		assert(m.toString() == "d41d8cd98f00b204e9800998ecf8427e");

..etc..

but I note in the std.md5 source the unittest is coded at the end of the file, at file scope.
std.md5 uses a struct and I have used a class, is that why? or have I done it wrong?

Regan.

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
June 07, 2004
You can do it either way.


June 07, 2004
On Mon, 7 Jun 2004 11:15:44 -0700, Walter <newshound@digitalmars.com> wrote:
> You can do it either way.

Does it make any difference? Scoping? etc?

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
June 07, 2004
"Regan Heath" <regan@netwin.co.nz> wrote in message news:opr88ux7pg5a2sq9@digitalmars.com...
> On Mon, 7 Jun 2004 11:15:44 -0700, Walter <newshound@digitalmars.com> wrote:
> > You can do it either way.
>
> Does it make any difference? Scoping? etc?

The scoping rules still apply.


Top | Discussion index | About this forum | D home