[Tutor] creating objects in a loop

Blake Winton bwinton@tor.dhs.org
Wed, 3 Apr 2002 09:45:04 -0500


* Erik Price <erikprice@mac.com> [020403 07:32]:
> I see -- another, different use for this test.  You put "echo value"
> or something in the if __name__ = "__main__" to make sure that the
> function is declared properly, or the value was indeed created.
> 
> Are tests like this native to Python?  I mean, I understand that
> these names may be unique to Python, but do people use similar
> techniques to this in Java and C?

In the olden days, I used to write a "main" method in all my
Java classes which would run some simple unit tests.  Then I found
JUnit (a unit testing framework for Java), and now I just write all my
unit tests in a separate class, and I don't have the main method
anymore.

So, for Java, yeah.  For C/C++, I haven't seen anything similar.

Later,
Blake.
-- 
9:40pm up 52 days, 21:07, 2 users, load average: 0.02, 0.09, 0.07