Callbacks in event loops are untestable

Bug #1040606 reported by Matt Jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
D Lang Helper
Fix Released
Critical
Unassigned

Bug Description

If you look at bug #864406, you can see that there is no way for callbacks to throw exceptions, thereby failing tests in the test runner. Instead the callbacks are run outside the test runner, and crash the program as an unhandled exception.

Revision history for this message
Matt Jones (workhorsy) wrote :

unittest {
    describe("thing",
        it("crash test suite", function() {
            set_timeout(function() {
                assert(false);
            }, 0.0f);
        })
    );
}

If you look at this code. You can see that what we need is two things. Firstly a way to flush all events inside the "it" function. Secondly a way to catch any exceptions throw from callbacks, and pass them to the "it" functions.

Revision history for this message
Matt Jones (workhorsy) wrote :
Changed in dlanghelper:
status: Confirmed → Fix Committed
Matt Jones (workhorsy)
Changed in dlanghelper:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.