PDA

View Full Version : lzunit.lzx is included, but it says file not found.


stephan
11-24-2003, 03:47 PM
I typed in the UnitTesting example.
http://lazslosystems.com/developers/learn/documentation/lzxref/testsuite.php

lzunit.lzx is included, but it says file not found.

antun
11-24-2003, 03:52 PM
I think the URL might have to be lz/lzunit.lzx maybe.

-Antun

stephan
11-24-2003, 09:45 PM
Thanks, I found it.

It's "lzunit/lzunit.lzx"

stephan
11-24-2003, 10:02 PM
I got to say this is one of the coolest looking UnitTesting framework I've seen. :D :D :D

One more question.
assertSame() works as expected, but why does something like assertEqual(null, "4") pass?

And two comments.
I don't know if it's a design decision on your part, but it would be nice if it counted the number of assertions as well. Tests:2 Assertions:5 Failures:1 Errors:0

And maybe I'm getting ahead of myself, but it would be even nicer if this testing framework automatically built the stubs for the classes, the instances, and the methods it was testing. So this way, when a class is not found and the test fails, the developer would just have to reload (or push a button) and then the test would pass. Kent Beck mentioned this recently and this feature is now starting to appear in UnitTesting Frameworks. And of course, this feature makes developers like myself want to write unit tests all the time. :D

ptw
11-25-2003, 10:00 AM
[why does ... assertEqual(null, "4") pass?]

Are you sure that exact case passes? assertEquals is testing the relation ==, which will do type conversion (see ECMAScript 262-3). So things like:

assertEquals(1, '1');
assertEquals(1, true);
assertEquals(true, '1');
assertEquals(0, false);
assertEquals('0', false);

will pass, and:

assertEquals(null, 'null');
assertEquals('undefined', undefined);
assertEquals(NaN, 0);
assertEquals(1, 'one');
assertEquals(1, 'true');
assertEquals('true', '1');

will not.

antun
11-25-2003, 11:08 AM
Glad you like it.

assertEqual() should read assertEquals() (it works fine if you change it). You should always run lzunit with the debugger on, that way you'd get a message that informs you of a non-existent method. Of course the example should reflect this, so I've filed bug 2977 on this.

I've also filed a feature request regarding your other comments - they're always welcome!

Thanks and take care,

Antun

stephan
11-25-2003, 09:33 PM
Thanks.

danil
07-16-2006, 10:56 PM
I am used setup wait method but it's going very fast and some methods are missing. so please help me anyone very soon.what should i do for this.please example code.

thanks
danil