VFPX / FoxUnit

Unit Testing in Visual FoxPro
25 stars 22 forks source link

Wish: Allow ESCAPE during testing #18

Open mikepotjer opened 5 years ago

mikepotjer commented 5 years ago

Enhance the test runner to SET ESCAPE ON and trap for the user pressing the ESCAPE key. I believe this should also cause that test to fail, and log an error message indicating that the user pressed ESCAPE.

This would be useful for scenarios where someone (who is probably not you, of course) accidentally created an infinite loop in code being tested. Instead of having to kill VFP and start over, the developer can abort the test and correct the problem in a normal refactor cycle.

mikepotjer commented 5 years ago

I would probably implement something like my ESCAPE handler code to trap for the ESCAPE key in the test runner. I posted the code for that in this Gist entry: https://gist.github.com/mikepotjer/43a1f244cc90531095d93cb2367cf4c8

If someone other than me implements this feature, they have unrestricted permission to use this code.

eselje commented 5 years ago

I like it. In a perfect world unit tests run very quickly, but as we know that doesn't always work out. Something like this will be a nice enhancement.

Eric

On Thu, Jan 3, 2019 at 12:58 PM Mike Potjer notifications@github.com wrote:

Enhance the test runner to SET ESCAPE ON and trap for the user pressing the ESCAPE key. I believe this should also cause that test to fail, and log an error message indicating that the user pressed ESCAPE.

This would be useful for scenarios where someone (who is probably not you, of course) accidentally created an infinite loop in code being tested. Instead of having to kill VFP and start over, the developer can abort the test and correct the problem in a normal refactor cycle.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/VFPX/FoxUnit/issues/18, or mute the thread https://github.com/notifications/unsubscribe-auth/AHy8TNoUVdMM57NyO29VOJcsq6SF4m6rks5u_lLzgaJpZM4Zomnx .