On Friday, May 8, 2020 at 2:50:03 AM UTC+2, btheado wrote: > > > I looked at the code but I don't understand how to run the hypothesis > tests. I would love to see it in action. Could you share the steps? > >
I use pytest for running the tests. Just 'pytest myleoqt.py'. Have you also considered using the property of random operation + undo = > original tree widget state? And random operation + undo + redo = 2nd state? > I'm not sure that would reveal anything from what you are already testing. > Just a thought. > > Brian > I haven't explicitly test that after undo outline reverts to what it was before and redo does the opposite. Actually for redo part there is no need to test because all commands are implemented in such a way that command first prepares and creates two functions dosomething and undosomething, and then just calls dosomething(). It means that if undo works correctly it is guaranteed that redo will do correctly as well. However, both of this commands undo and redo are on the list of possible choices for hypothesis. So, the test executes both of them in the combination with all other commands. I think I'll add that at the end of the test full undo stack gets undone and then to check whether the outline has the same shape as it was on the start. Checking every step with undo, redo is possible too. Vitalije -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/44f56c4a-485e-4ec9-89aa-06ecd65dbd47%40googlegroups.com.
