From: Daniel R. <da...@ph...> - 2008-08-25 05:07:46
|
Greetings, I thought I could write a cleaner version of expandSynonyms. Then I discovered writing and verifying TH is hard! So I wrote some code for debugging and testing TH functions. There is a module now called HOC.THDebug that contains some useful printing methods. In Tests there is also now a target thtests that compiles two files for testing expandSynonyms. Because it is TH, the test actually runs from within the compiler. To run the test, you compile the program. thtests actually ensures that the compile is run every time. If the compile succeeds, the test passed! It needs work to be a real test harness, but I think it's something to build on. Beyond that, runIO and the code in THDebug are tremendously useful for outputting intermediate results (during compile) of your TH code. -- Daniel |