Rev 2864 of the trunk fixes one of the strangest bugs I hope ever to see. This bug caused Leo's paste-outline command to work differently during unit testing than it otherwise does. Although this bug was easily reproducible, it took several hours of tracing to discover its cause.
The culprit was an absolutely brain-dead hack in tnodeAttributes method in the sax read code that did something different (and wrong) when unit testing! As soon as I saw it, I burst out laughing, and chuckled to myself for almost a full minute. I absolutely couldn't believe my eyes. What was going on? All became clear when I re-ran the unit tests. The @test tnodeAttributes test failed. Looking at the test, I saw that it was playing weird games trying to set up an environment to test tnodeAttributes specifically. So the hack must have been a dim-witted attempt to "help" the unit test. Never mind that it could destroy other unit tests. For that matter, never mind that the test isn't needed at all: the code gets executed every time Leo loads. Ah well. It was good for a laugh. And it's a good lesson. It's ok to *add* code to help unit tests, but it's insane to *change* the code being tested to support unit tests. 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.
