Permalink
Browse files

Add test for compatibility with renamed JSLint options

Create jslintRenamed.js unit test which tests handling of the
"/*jslint" eqeq option.  If the option name is not converted from "eqeq"
to "eqeqeq" and the value inverted, the test will fail.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
  • Loading branch information...
1 parent c788615 commit 03596ac068dca6fee3d3b37c6642db6239ee4cd3 @kevinoid kevinoid committed with valueof Apr 4, 2012
Showing with 12 additions and 0 deletions.
  1. +7 −0 tests/unit/core.js
  2. +5 −0 tests/unit/fixtures/jslintRenamed.js
View
@@ -242,6 +242,13 @@ exports.jslintInverted = function () {
TestRun().test(src);
};
+exports.jslintRenamed = function () {
+ var src = fs.readFileSync(__dirname + '/fixtures/jslintRenamed.js', 'utf8');
+ TestRun()
+ .addError(4, "Expected '===' and instead saw '=='.")
+ .test(src);
+};
+
exports.caseExpressions = function () {
var src = fs.readFileSync(__dirname + '/fixtures/caseExpressions.js', 'utf8');
TestRun()
@@ -0,0 +1,5 @@
+/*jslint eqeq: false */
+
+var i, j;
+if (i == j) {
+}

0 comments on commit 03596ac

Please sign in to comment.