+ same( jQuery("#area1").prevAll().get(), elems.get(), "Simple prevAll check" );
+ same( jQuery("#area1").prevAll('input').get(), elems.filter('input').get(), "Filtered prevAll check" );
+ same( jQuery("#area1").prevAll('input,select').get(), elems.filter('input,select').get(), "Multiple-filtered prevAll check" );
+ same( jQuery("#area1, #hidden1").prevAll('input,select').get(), elems.filter('input,select').get(), "Multi-source, multiple-filtered prevAll check" );
+});
+
+test("nextUntil([String])", function() {
+ expect(10);
+
+ var elems = jQuery('#form').children().slice( 2, 12 );
+
+ same( jQuery("#text1").nextUntil().get(), jQuery("#text1").nextAll().get(), "nextUntil with no selector (nextAll)" );
+ same( jQuery("#text1").nextUntil(".foo").get(), jQuery("#text1").nextAll().get(), "nextUntil with invalid selector (nextAll)" );
+ same( jQuery("#text1").nextUntil("#area1").get(), elems.get(), "Simple nextUntil check" );
+ equals( jQuery("#text1").nextUntil("#text2").length, 0, "Simple nextUntil check" );
+ same( jQuery("#text1").nextUntil("#area1, #radio1").get(), jQuery("#text1").next().get(), "Less simple nextUntil check" );
+ same( jQuery("#text1").nextUntil("#area1", "input").get(), elems.not("button").get(), "Filtered nextUntil check" );
+ same( jQuery("#text1").nextUntil("#area1", "button").get(), elems.not("input").get(), "Filtered nextUntil check" );
+ same( jQuery("#text1").nextUntil("#area1", "button,input").get(), elems.get(), "Multiple-filtered nextUntil check" );
+ equals( jQuery("#text1").nextUntil("#area1", "div").length, 0, "Filtered nextUntil check, no match" );
+ same( jQuery("#text1, #hidden1").nextUntil("#area1", "button,input").get(), elems.get(), "Multi-source, multiple-filtered nextUntil check" );
+});
+
+test("prevUntil([String])", function() {
+ expect(10);
+
+ var elems = jQuery("#area1").prevAll();
+
+ same( jQuery("#area1").prevUntil().get(), elems.get(), "prevUntil with no selector (prevAll)" );
+ same( jQuery("#area1").prevUntil(".foo").get(), elems.get(), "prevUntil with invalid selector (prevAll)" );
+ same( jQuery("#area1").prevUntil("label").get(), elems.not(':last').get(), "Simple prevUntil check" );
+ equals( jQuery("#area1").prevUntil("#button").length, 0, "Simple prevUntil check" );
+ same( jQuery("#area1").prevUntil("label, #search").get(), jQuery("#area1").prev().get(), "Less simple prevUntil check" );
+ same( jQuery("#area1").prevUntil("label", "input").get(), elems.not(':last').not("button").get(), "Filtered prevUntil check" );
+ same( jQuery("#area1").prevUntil("label", "button").get(), elems.not(':last').not("input").get(), "Filtered prevUntil check" );
+ same( jQuery("#area1").prevUntil("label", "button,input").get(), elems.not(':last').get(), "Multiple-filtered prevUntil check" );
+ equals( jQuery("#area1").prevUntil("label", "div").length, 0, "Filtered prevUntil check, no match" );
+ same( jQuery("#area1, #hidden1").prevUntil("label", "button,input").get(), elems.not(':last').get(), "Multi-source, multiple-filtered prevUntil check" );
+});
+
+test("slice()", function() {
+ expect(7);
+
+ var $links = jQuery("#ap a");
+
+ same( $links.slice(1,2).get(), q("groups"), "slice(1,2)" );
+ same( $links.slice(1).get(), q("groups", "anchor1", "mark"), "slice(1)" );
+ same( $links.slice(0,3).get(), q("google", "groups", "anchor1"), "slice(0,3)" );
+ same( $links.slice(-1).get(), q("mark"), "slice(-1)" );
+
+ same( $links.eq(1).get(), q("groups"), "eq(1)" );
+ same( $links.eq('2').get(), q("anchor1"), "eq('2')" );
+ same( $links.eq(-1).get(), q("mark"), "eq(-1)" );
+});
+
+test("first()/last()", function() {
+ expect(4);
+
+ var $links = jQuery("#ap a"), $none = jQuery("asdf");
+
+ same( $links.first().get(), q("google"), "first()" );
+ same( $links.last().get(), q("mark"), "last()" );
+
+ same( $none.first().get(), [], "first() none" );
+ same( $none.last().get(), [], "last() none" );