Re: [Perlunit-users] Using @TESTS for changing tests execution order
Status: Beta
Brought to you by:
mca1001
From: Dmitry D. <dd...@ic...> - 2003-10-14 21:09:39
|
Phlip wrote: >>Suppose that one test is for database INSERT statement, and the other -- >>for SELECT, and that last -- for DELETE. That way I need to maintain the >>order of tests execution. Of course, I can put all operations into one >>test instead. > > > Uh, one common trick here is to put into setUp() a BEGIN TRANSACTION, then > put into tearDown a ROLLBACK. > > But it sounds like you should randomize the order of your tests. Unless you > are testing quite crufty legacy code, where you must rely on a certain > amount of setUp before testing everything, your tests should all be totally > severable. > > When you achieve that, come back to me and tell me how you did it. ;-) > > -- > Phlip > http://www.c2.com/cgi/wiki?TestFirstUserInterfaces > Can you suggest a structure of tests for testing insert, select and delete operations? I suppose that I can write something like tis: sub test_001_insert { ... insert record and do some tets } sub test_002_select { ... select record inserted in previous test and do some tets } sub test_003_delete { ... delete the above record and do some tets } -- Dmitry. |