On Mon, Mar 16, 2009 at 11:59 AM, tfer <[email protected]> wrote: > > I looked at the tutorial on @test usage and finally realized why it > wasn't working for me. In order for the @test to have the code loaded > so it can test it, (when your not working on loaded, Leo code), you > need to grab it from somewhere and then follow it with test. The way > the tutorial handles this is to have an @file node at the top of your > code, so the @test can load it via an import.
I wouldn't describe things this way. When you run an @test node using the run-unit-tests-locally command, or its equivalent (say with an @button script), the code you are testing is the code that is loaded when you load the .leo file containing the tests, the original .leo file. OTOH, when you run an @test node using the run-unit-tests command (or equivalent), Leo creates an external .leo file, fires up that file and runs the tests in *that* .leo file. In that case, the code you are testing is the last code saved, regardless of when you loaded the *original* .leo file. So in general, you have two ways of testing the very latest code: 1. Reload the .leo file containing the @test node you want to test. 2. Use the run-unit-tests command to run the unit tests externally. Typically, I reload unitTests.leo before running the tests. That is, I use the first method. BTW, I have an alias (Linux) or .bat file (XP) called 'u' that loads unitTests.leo. So reloading this file is simply a matter of Alt-tabbing to a console and typing u <return>. HTH. Edward --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
