Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Pullreq 7 - assert.throws isn't someone very special; address it like all the other assert.xyz methods. #145

Merged
merged 2 commits into from

2 participants

@GerHobbelt

See also the commit message itself. I saw that there was a lot hiding under the rug in #143 due to the git merge process I use; here's the manual extract of most of the goodies. (The submodules/makefile work is not included as that's probably too much 'It Works Here(tm)' now)


  • assert.throws isn't someone very special; address it like all the other assert.xyz methods.
@zaach
Owner

Good 'ol remnants of ES3.

@zaach zaach merged commit 40d7bf6 into zaach:master
@GerHobbelt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 16, 2013
  1. @GerHobbelt

    gitignore: editor bak files

    GerHobbelt authored
  2. @GerHobbelt
This page is out of date. Refresh to see the latest.
View
4 .gitignore
@@ -1,2 +1,6 @@
.DS_Store
node_modules
+
+# Editor backup files
+*.bak
+*~
View
8 tests/parser/api.js
@@ -97,7 +97,7 @@ exports["test start symbol should be nonterminal"] = function () {
}
};
- assert["throws"](function(){new Jison.Generator(grammar);}, "throws error");
+ assert.throws(function(){new Jison.Generator(grammar);}, "throws error");
};
exports["test token list as string"] = function () {
@@ -220,7 +220,7 @@ exports["test custom parse error method"] = function () {
throw str;
};
- assert["throws"](function () {parser.parse("aga")});
+ assert.throws(function () {parser.parse("aga")});
assert.strictEqual(result.text, "a", "parse error text should equal b");
assert.strictEqual(typeof result.token, 'string', "parse error token should be a string");
assert.strictEqual(result.line, 0, "hash should include line number");
@@ -251,7 +251,7 @@ exports["test no default resolve"] = function () {
assert.ok(gen.table.length == 4, "table has 4 states");
assert.ok(gen.conflicts == 2, "encountered 2 conflicts");
- assert["throws"](function () {parser.parse("xx")}, "throws parse error for multiple actions");
+ assert.throws(function () {parser.parse("xx")}, "throws parse error for multiple actions");
};
@@ -270,7 +270,7 @@ exports["test EOF in 'Unexpected token' error message"] = function () {
assert.ok(str.match("end of input"));
};
- assert['throws'](function () {parser.parse("xx"); });
+ assert.throws(function () {parser.parse("xx"); });
};
View
6 tests/parser/errorlab.js
@@ -91,7 +91,7 @@ exports["test no recovery"] = function () {
var parser = new Jison.Parser(grammar, {type: "lr0"});
parser.lexer = new Lexer(lexData);
- assert["throws"](function (){parser.parse('xxgy')}, "should throw");
+ assert.throws(function (){parser.parse('xxgy')}, "should throw");
};
exports["test error after error recovery"] = function () {
@@ -115,7 +115,7 @@ exports["test error after error recovery"] = function () {
var parser = new Jison.Parser(grammar, {type: "lr0"});
parser.lexer = new Lexer(lexData);
- assert["throws"](function (){parser.parse('gxxx;')}, "should return bar");
+ assert.throws(function (){parser.parse('gxxx;')}, "should return bar");
};
exports["test throws error despite recovery rule"] = function() {
@@ -144,7 +144,7 @@ exports["test throws error despite recovery rule"] = function() {
var expectedAST = ["+", ["+", [0], [0]], [0]];
- assert['throws'](function (){(parser.parse("0+0+0>"), expectedAST);});
+ assert.throws(function (){(parser.parse("0+0+0>"), expectedAST);});
};
exports["test correct AST after error recovery abrupt end"] = function() {
View
4 tests/parser/lalr.js
@@ -25,7 +25,7 @@ exports["test 0+0 grammar"] = function () {
assert.ok(parser.parse("0+0+0"), "parse");
assert.ok(parser.parse("0"), "parse single 0");
- assert["throws"](function () {parser.parse("+")}, "throws parse error on invalid");
+ assert.throws(function () {parser.parse("+")}, "throws parse error on invalid");
};
exports["test xx nullable grammar"] = function () {
@@ -48,7 +48,7 @@ exports["test xx nullable grammar"] = function () {
assert.ok(parser.parse("xxx"), "parse");
assert.ok(parser.parse("x"), "parse single x");
- assert["throws"](function (){parser.parse("+");}, "throws parse error on invalid");
+ assert.throws(function (){parser.parse("+");}, "throws parse error on invalid");
};
exports["test LALR algorithm from Bermudez, Logothetis"] = function () {
View
4 tests/parser/lr0.js
@@ -25,7 +25,7 @@ exports["test left-recursive nullable grammar"] = function () {
assert.ok(parser.parse('xxx'), "parse 3 x's");
assert.ok(parser.parse("x"), "parse single x");
- assert["throws"](function () {parser.parse("y")}, "throws parse error on invalid token");
+ assert.throws(function () {parser.parse("y")}, "throws parse error on invalid token");
};
exports["test right-recursive nullable grammar"] = function () {
@@ -68,5 +68,5 @@ exports["test 0+0 grammar"] = function () {
assert.ok(parser.parse("0+0+0"), "parse");
assert.ok(parser.parse("0"), "parse single 0");
- assert["throws"](function () {parser.parse("+")}, "throws parse error on invalid");
+ assert.throws(function () {parser.parse("+")}, "throws parse error on invalid");
};
View
2  tests/parser/lr1.js
@@ -23,7 +23,7 @@ exports["test xx nullable grammar"] = function () {
assert.ok(parser.parse("xxx"), "parse");
assert.ok(parser.parse("x"), "parse single x");
- assert["throws"](function (){parser.parse("+");}, "throws parse error on invalid");
+ assert.throws(function (){parser.parse("+");}, "throws parse error on invalid");
};
exports["test LR parse"] = function () {
View
2  tests/parser/precedence.js
@@ -160,7 +160,7 @@ exports["test Non-associative operator"] = function () {
var parser = new Jison.Parser(grammar, {type: "lalr"});
parser.lexer = new RegExpLexer(lexData);
- assert["throws"](function () {parser.parse("x=x=x");}, "throws parse error when operator used twice.");
+ assert.throws(function () {parser.parse("x=x=x");}, "throws parse error when operator used twice.");
assert.ok(parser.parse("x=x"), "normal use is okay.");
};
View
2  tests/parser/slr.js
@@ -26,7 +26,7 @@ exports["test left-recursive nullable grammar"] = function () {
assert.ok(parser.parse('xxx'), "parse 3 x's");
assert.ok(parser.parse("x"), "parse single x");
- assert["throws"](function(){parser.parse("y")}, "throws parse error on invalid token");
+ assert.throws(function(){parser.parse("y")}, "throws parse error on invalid token");
assert.ok(gen.conflicts == 0, "no conflicts");
};
Something went wrong with that request. Please try again.