The following is a first draft of a unit-testing tutorial.  It will form 
the basis of a new help-for-unit-testing command, and may also become the 
introduction to Leo unit-testing chapter.

All comments are welcome.  Please let me know if anything is unclear.

-----

Leo makes it easy to create and run unit tests from individual outline 
nodes or trees.

A node whose headline starts with @tests defines a unit test.

The body text of the @test node contains a **self-contained** unit test.

For example, this creates a complete unit test::

    @test fails  (headline)
    assert False (body text)

To run this test, select the @test node and do:
<alt-x>run-selected-unit-tests-locally.
Leo will create and run the unit test automatically.

To see all of Leo's unit testing commands, do:
<alt-x>run<tab>

Leo pre-defines 'c', 'g' and 'p' in unit tests just as in scripts.

For more details about unit testing, see: 
http://leoeditor.com/unitTesting.html

**Notes for Leo developers**

leo/test/unitTest.leo contains all of Leo's own unit tests.

Running all tests is not necessary.  Just select::

    Active Unit Tests

and then do Alt-4 (run-selected-unit-tests-locally).

**Note**: Some tests will likely fail on machines other than EKR's.
You only need to be concerned about unit tests that start failing after you 
make your changes.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to