Skip to content

Commit

Permalink
Merge pull request #25 from hpbuniat/master
Browse files Browse the repository at this point in the history
Some minor additons from hpbuniat
  • Loading branch information
padolsey committed May 23, 2011
2 parents 1368dbe + d3593d1 commit 551c210
Show file tree
Hide file tree
Showing 15 changed files with 21,631 additions and 69 deletions.
100 changes: 66 additions & 34 deletions jquery.lint.js
100644 → 100755

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion meta/api.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion meta/api.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Api_Parser {
public function load($sUrl) {
$aContextOptions = array(
'http' => array(
'method' => "GET"
'method' => 'GET'
)
);
$rStreamContext = stream_context_create($aContextOptions);
Expand Down Expand Up @@ -107,6 +107,11 @@ private function _parse() {
$aArg['type'] = 'Object, Function';
$aArg['multiple'] = true;
}
elseif ($aArg['name'] === 'value' and $aArg['type'] === 'Object') {
// hack to catch data-internal-usage
$aArg['type'] = '*';
$aArg['multiple'] = true;
}

$sName = $aArg['name'];
}
Expand Down
2 changes: 1 addition & 1 deletion test/1.3.2/index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="../qunit.css" type="text/css" media="screen">
<script src="jquery.js"></script>
<script src="jquery.js"></script>
<script src="jquery.js"></script>
<script>jQ = jQuery.noConflict(true);</script>
<script src="../qunit.js"></script>
<script src="../../jquery.lint.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/1.4.4/index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="../qunit.css" type="text/css" media="screen">
<script src="jquery.js"></script>
<script src="jquery.js"></script>
<script src="jquery.js"></script>
<script>jQ = jQuery.noConflict(true);</script>
<script src="../qunit.js"></script>
<script src="../../jquery.lint.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/1.5.2/index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="../qunit.css" type="text/css" media="screen">
<script src="jquery.js"></script>
<script src="jquery.js"></script>
<script src="jquery.js"></script>
<script>jQ = jQuery.noConflict(true);</script>
<script src="../qunit.js"></script>
<script src="../../jquery.lint.js"></script>
Expand Down
20 changes: 0 additions & 20 deletions test/1.5.2/test.html

This file was deleted.

2 changes: 1 addition & 1 deletion test/1.6.1/index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="../qunit.css" type="text/css" media="screen">
<script src="jquery.js"></script>
<script src="jquery.js"></script>
<script src="jquery.js"></script>
<script>jQ = jQuery.noConflict(true);</script>
<script src="../qunit.js"></script>
<script src="../../jquery.lint.js"></script>
Expand Down
66 changes: 57 additions & 9 deletions test/test.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ jQuery.ajaxSetup({

test('jQuery()', function(){

expect(3);
expect(4);
$.LINT.level = 1;

if ($.fn.jquery >= '1.4') jQuery();
$(document).ready(function() {});
$(function() {});

$('#k928372');
$('.k928372');

Expand Down Expand Up @@ -74,10 +74,11 @@ test('css()', function(){

test('attr()', function(){

expect(2);
expect(3);

$('<a/>').attr('rel','a').attr('href', '...');
$('<a/>').attr('a','b','c','d');
$('<a/>').attr('id');

$('<a/>').attr('a');
$('<a/>').attr('b');
Expand All @@ -86,6 +87,25 @@ test('attr()', function(){

});

test('data()', function(){
var struct = $('<div><a/><a/></div>');

if ($.fn.jquery >= '1.4') {
expect(3);

// working
jQuery.data(document.body, 'data', 'data');
jQuery.data(document.body, 'events', undefined, true);
$('<a/>').data('data', 'data');
$('<a/>').data('data');

// failing
jQuery.data(struct, 'data', 'data');
jQuery.data([]);
jQuery.data({});
}
});

test('bind()', function(){

expect(3);
Expand All @@ -111,6 +131,7 @@ test('bind()', function(){
test('repeat selectors', function(){

jQuery.LINT.enabledReports.noElementsFound = false;
jQuery.LINT.enabledReports.slowSelector = false;

expect(1);

Expand All @@ -120,6 +141,7 @@ test('repeat selectors', function(){
$('a', struct);

jQuery.LINT.enabledReports.noElementsFound = true;
jQuery.LINT.enabledReports.slowSelector = true;

});

Expand All @@ -128,6 +150,7 @@ test('pseudo', function(){
expect(3);

jQuery.LINT.enabledReports.noElementsFound = false;
jQuery.LINT.enabledReports.slowSelector = false;

// valid
$('div:not(.foo:last):first');
Expand All @@ -140,6 +163,7 @@ test('pseudo', function(){
$('div:not(.foo:abcdefg):first');

jQuery.LINT.enabledReports.noElementsFound = true;
jQuery.LINT.enabledReports.slowSelector = true;

});

Expand Down Expand Up @@ -421,7 +445,7 @@ test('extend()', function(){

test('Callbacks to jQuery methods', function(){

expect(3);
expect(jQuery.fn.jquery <= '1.4' ? 3 : 2);

var j = $('<div/>');

Expand All @@ -433,12 +457,36 @@ test('Callbacks to jQuery methods', function(){
j.find('a'); // should get noElementsFound error
});

stop();
$.get('foo.xml', function(){
j.find('a'); // should get noElementsFound error
start();
});
if (jQuery.fn.jquery <= '1.4') {
stop();
$.get('foo.xml', function(){
start();
j.find('a'); // should get noElementsFound error
});
}

});

test('Test inefficient selectors', function(){
jQuery.LINT.enabledReports.noElementsFound = false;
jQuery.LINT.enabledReports.slowSelector = true;
$.LINT.level = 2;

expect(6);

$('#k928372');
$('div.k928372');
var j = $('#qunit-testrunner-toolbar');
$('.k928372', j);

$('#k928372 > .k928372');
$('.k928372', {});
$('.k928372');
$('div#k928372');
$('div #k928372');
$('#id #k928372');

jQuery.LINT.enabledReports.noElementsFound = true;
});

})(jQuery);
22 changes: 22 additions & 0 deletions test/ui-1.8.13/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="../qunit.css" type="text/css" media="screen">
<script src="jquery.js"></script>
<script src="ui-1.8.13.js"></script>
<script src="jquery.js"></script>
<script>jQ = jQuery.noConflict(true);</script>
<script src="../qunit.js"></script>
<script src="../../jquery.lint.js"></script>
<script src="../test.js"></script>
<script src="../ui-test.js"></script>
</head>
<body>
<h1 id="qunit-header">jQuery Lint test suite</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
</body>
</html>
Loading

0 comments on commit 551c210

Please sign in to comment.