X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fevent.js;h=2937b1c02475f56e3d7de18ed3c262369398300e;hb=104757705a19df3b6b9750aaef30aa451082f825;hp=9ce6e2f6b42ad886d8155d6f1cb0846095db000f;hpb=e177465a6b65aecbb87486f6243410ffabfe14b7;p=jquery.git diff --git a/test/unit/event.js b/test/unit/event.js index 9ce6e2f..2937b1c 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -317,6 +317,26 @@ test("bind(), with same function", function() { equals(count, 1, "Verify that removing events still work." ); }); + +test("bind(), make sure order is maintained", function() { + expect(1); + + var elem = jQuery("#firstp"), log = [], check = []; + + for ( var i = 0; i < 100; i++ ) (function(i){ + elem.bind( "click", function(){ + log.push( i ); + }); + + check.push( i ); + })(i); + + elem.trigger("click"); + + equals( log.join(","), check.join(","), "Make sure order was maintained." ); + + elem.unbind("click"); +}); test("bind(), with different this object", function() { expect(4);