+test("init", function() {\r
+ expect(6);\r
+\r
+ el = $("#autocomplete").autocomplete();\r
+ ok(true, '.autocomplete() called on element');\r
+\r
+ $([]).autocomplete();\r
+ ok(true, '.autocomplete() called on empty collection');\r
+\r
+ $("<input/>").autocomplete();\r
+ ok(true, '.autocomplete() called on disconnected DOMElement');\r
+\r
+ $("<input/>").autocomplete().autocomplete("foo");\r
+ ok(true, 'arbitrary method called after init');\r
+\r
+ $("<input/>").autocomplete().data("foo.autocomplete");\r
+ ok(true, 'arbitrary option getter after init');\r
+\r
+ $("<input/>").autocomplete().data("foo.autocomplete", "bar");\r
+ ok(true, 'arbitrary option setter after init');\r
+});\r
+\r
+test("destroy", function() {\r
+ expect(6);\r
+\r
+ $("#autocomplete").autocomplete().autocomplete("destroy"); \r
+ ok(true, '.autocomplete("destroy") called on element');\r
+\r
+ $([]).autocomplete().autocomplete("destroy");\r
+ ok(true, '.autocomplete("destroy") called on empty collection');\r
+\r
+ $("<input/>").autocomplete().autocomplete("destroy");\r
+ ok(true, '.autocomplete("destroy") called on disconnected DOMElement');\r
+\r
+ $("<input/>").autocomplete().autocomplete("destroy").autocomplete("foo");\r
+ ok(true, 'arbitrary method called after destroy');\r
+\r
+ $("<input/>").autocomplete().autocomplete("destroy").data("foo.autocomplete");\r
+ ok(true, 'arbitrary option getter after destroy');\r
+\r
+ $("<input/>").autocomplete().autocomplete("destroy").data("foo.autocomplete", "bar");\r
+ ok(true, 'arbitrary option setter after destroy');\r
+});\r
+\r
+\r
test("highlighter", function() {\r
equals( jQuery.Autocompleter.defaults.highlight("Peter", "Pe"), "<strong>Pe</strong>ter" );\r
equals( jQuery.Autocompleter.defaults.highlight("Peter <em><Pan></em>", "Pe"), "<strong>Pe</strong>ter <em><Pan></em>" );\r