Callbacks in event loops are untestable
Bug #1040606 reported by
Matt Jones
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.
Changed in dlanghelper: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
unittest { "thing" ,
set_ timeout( function( ) {
assert( false);
describe(
it("crash test suite", function() {
}, 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.