Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwing committed Sep 10, 2012
1 parent 63fd3bf commit 6b441c2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/css/Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ Parser.prototype = function(){

//there must be a next selector
if (nextSelector === null){
this._unexpectedToken(this.LT(1));
this._unexpectedToken(tokenStream.LT(1));
} else {

//nextSelector is an instance of SelectorPart
Expand Down
16 changes: 16 additions & 0 deletions tests/css/Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,22 @@
var result = parser.parse(".foo {\n; color: #fff;\n}");
}
}));

suite.add(new YUITest.TestCase({

name: "Invalid CSS Parsing Tests",

"Test parsing invalid celector": function(){
var error;
var parser = new Parser();
parser.addListener("error", function(e){error = e});
parser.parse("c++{}");

Assert.areEqual("error", error.type);
Assert.areEqual(1, error.line);
Assert.areEqual(3, error.col);
}
}));


YUITest.TestRunner.add(suite);
Expand Down

0 comments on commit 6b441c2

Please sign in to comment.