if(!dojo._hasResource["tests._base.connect"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["tests._base.connect"] = true; dojo.provide("tests._base.connect"); hub = function(){ } failures = 0; bad = function(){ failures++; } good = function(){ } // make 'iterations' connections to hub // roughly half of which will be to 'good' and // half to 'bad' // all connections to 'bad' are disconnected // test can then be performed on the values // 'failures' and 'successes' markAndSweepTest = function(iterations){ var marked = []; // connections for(var i=0; i