Unit Tests

Mark Wieder mwieder at ahsoftware.net
Fri Jun 29 22:37:00 EDT 2007


David-

Friday, June 29, 2007, 8:45:35 AM, you wrote:

> Yes - except i was planning to store them as text files optionally indexed
> by an sqlite database - so the test can go in svn. Any examples you can
> share?

I store tests as executable scripts and test suites as lists of tests.
I suppose the tests could be written out as text files and subversed,
and it's an interesting idea, but one I haven't had to put into play.
Here's a simple db table-creation test. The testCreateTable handler
takes care of logging the result, and the test framework handles the
rest (loop iteration, pass/fail logging, error handling, test setup
and teardown, etc):

on testCreateTable2
  local tFieldArray
  
  put "integer primary key" into tFieldArray[1,"id"]
  put "text" into tFieldArray[2,"name"]
  put "text" into tFieldArray[3,"phone"]
  testCreateTable tconnectionid, "test2", tFieldArray
end testCreateTable2

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list