Permalink
Browse files

remove unnecessary tests

  • Loading branch information...
1 parent c2fbd79 commit 832e641f917691cc8dfb458427dda6d8aa759266 @rvagg rvagg committed Feb 5, 2012
Showing with 0 additions and 76 deletions.
  1. +0 −76 tests/tests.js
View
@@ -122,82 +122,6 @@ sinkSuite('CSS 2', function (test, ok) {
});
-sinkSuite('CSS 2 identification', function (test, ok) {
- // cases that we should be able to pass through to native non-CSS3 qSA where present (IE8)
- // we get to ignore grouping here since selectors are split up for this case anyway
- // we also get to work with normalized selectors
- // this regex must be kept in sync with the one in src/qwery.js for the test to make sense
- var css2 = /^(([\w\-]*[#\.]?[\w\-]+|\*)?(\[[\w\-]+([\~\|]?=['"][ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+["'])?\])?(\:(link|visited|active|hover))?([\s>+~\.,]|(?:$)))+$/
- , css2Selectors = [
- '*',
- , 'DIV',
- , 'e1 e2',
- , 'parent>child'
- , 'parent+child'
- , 'parent~child' // CSS3 but IE8 supports ~
- , '#id'
- , 'el#id'
- , 'el #id'
- , 'el>#id'
- , '#id>#id2'
- , '.class'
- , 'div.class'
- , '#id.class'
- , 'element.with.multiple.classes>bam'
- //, 'el:first-child' -> IE8 buggy, don't do native
- , 'a:link'
- , 'a#id:link'
- , '.class:visited'
- , '#boo:active'
- , 'div.class:hover'
- //, '*:focus' -> IE8 doesn't support, don't do native
- , 'hoo[foo]'
- , '#hah[boo="moo"]'
- , '.claz[attrib~=\'nooooooo!\']'
- , 'ele[prop|="huh?"]'
- , '.direct-descend>.direct-descend>.direct-descend'
- , '.direct-descend>.direct-descend>.direct-descend~.lvl2'
- ]
- , nonCSS2Selectors = [
- 'p:empty'
- , 'hoo:enabled'
- , 'haa:disabled'
- , '#bing:checked'
- , '*:first-of-type'
- , '*:last-of-type'
- , '.class:last-child'
- , 'yes:not'
- , 'p:nth-child(2n+1)'
- , 'p:nth-last-child(1n+2)'
- , 'p:nth-last-of-type(3n+3)'
- , 'p:nth-of-type(4n+2)'
- , '*:only-child'
- , '*:only-of-type'
- , 'p#id:root'
- , '#gak::selection'
- , 'body:target'
- // CSS2 buggy
- , 'el:first-child'
- , '*:focus'
- ]
-
- test('CSS2 selectors', css2Selectors.length, function() {
- for (var i = 0; i < css2Selectors.length; i++) {
- ok(css2.test(css2Selectors[i]), 'matched ' + css2Selectors[i])
- }
- })
-
- test('CSS2 selectors grouped', 1, function() {
- ok(css2.test(css2Selectors.join(',')), 'matched grouped CSS2 selectors')
- })
-
- test('non-CSS2 selectors', nonCSS2Selectors.length, function() {
- for (var i = 0; i < nonCSS2Selectors.length; i++) {
- ok(!css2.test(nonCSS2Selectors[i]), 'did not matche ' + nonCSS2Selectors[i])
- }
- })
-});
-
sinkSuite('attribute selectors', function (test, ok, b, a, assert) {
/* CSS 2 SPEC */

0 comments on commit 832e641

Please sign in to comment.