On Sat, Oct 6, 2018 at 8:10 AM <[email protected]> wrote:

I recently tried writing my own logic for commenting and uncommenting lines.
>

First of all, Leo's add-comments and delete-comments commands probably do
what you want. There are unit tests in unitTest.leo.  See the node Active
Unit Tests-->@file activeUnitTests.txt-->Organized by
file-->leoCommands-->add/delete comments

These unit tests use c.addComments() to do the work. So by extension, one
way would be to define your new commands using @g.command and then your
@test node would use use the new command.

But there may be an easier way.  See the FAQ entry: How can I use dev nodes
to develop and test Leo's own code?

The "dev script" *is *the unit test during development.

Later, you could add proper @test nodes somewhere. They would access your
new code, perhaps using c.k.simulateCommand('new-command')

HTH.  Feel free to ask more questions.

Edward

-- 
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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to