summaryrefslogtreecommitdiffstats
path: root/spec/parser.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2014-08-23 16:29:22 -0500
committerkpdecker <kpdecker@gmail.com>2014-08-23 16:29:22 -0500
commit529e2b67960dba2e41122fc4d56b5c2af5ada9a5 (patch)
tree9b4af5981298bccc8e90d57b66773da7b7a1543f /spec/parser.js
parent3531e041174509c6c3c69417b1714dcda6bccb3e (diff)
parenteee2c4d4f29e233280907bc89a32556de66fe783 (diff)
downloadhandlebars.js-529e2b67960dba2e41122fc4d56b5c2af5ada9a5.zip
handlebars.js-529e2b67960dba2e41122fc4d56b5c2af5ada9a5.tar.gz
handlebars.js-529e2b67960dba2e41122fc4d56b5c2af5ada9a5.tar.bz2
Merge branch 'refactor-parser' of github.com:mmun/handlebars.js into mmun-refactor-parser
Conflicts: lib/handlebars/compiler/ast.js spec/ast.js src/handlebars.yy
Diffstat (limited to 'spec/parser.js')
-rw-r--r--spec/parser.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/parser.js b/spec/parser.js
index 076ce36..131160a 100644
--- a/spec/parser.js
+++ b/spec/parser.js
@@ -121,11 +121,11 @@ describe('parser', function() {
});
it('parses empty blocks with empty inverse section', function() {
- equals(ast_for("{{#foo}}{{^}}{{/foo}}"), "BLOCK:\n {{ ID:foo [] }}\n PROGRAM:\n");
+ equals(ast_for("{{#foo}}{{^}}{{/foo}}"), "BLOCK:\n {{ ID:foo [] }}\n PROGRAM:\n {{^}}\n");
});
it('parses empty blocks with empty inverse (else-style) section', function() {
- equals(ast_for("{{#foo}}{{else}}{{/foo}}"), "BLOCK:\n {{ ID:foo [] }}\n PROGRAM:\n");
+ equals(ast_for("{{#foo}}{{else}}{{/foo}}"), "BLOCK:\n {{ ID:foo [] }}\n PROGRAM:\n {{^}}\n");
});
it('parses non-empty blocks with empty inverse section', function() {
@@ -147,6 +147,9 @@ describe('parser', function() {
it('parses a standalone inverse section', function() {
equals(ast_for("{{^foo}}bar{{/foo}}"), "BLOCK:\n {{ ID:foo [] }}\n {{^}}\n CONTENT[ 'bar' ]\n");
});
+ it('parses a standalone inverse section', function() {
+ equals(ast_for("{{else foo}}bar{{/foo}}"), "BLOCK:\n {{ ID:foo [] }}\n {{^}}\n CONTENT[ 'bar' ]\n");
+ });
it("raises if there's a Parse error", function() {
shouldThrow(function() {
@@ -184,7 +187,7 @@ describe('parser', function() {
describe('externally compiled AST', function() {
it('can pass through an already-compiled AST', function() {
- equals(ast_for(new Handlebars.AST.ProgramNode(false, [ new Handlebars.AST.ContentNode("Hello")])), "CONTENT[ \'Hello\' ]\n");
+ equals(ast_for(new Handlebars.AST.ProgramNode([ new Handlebars.AST.ContentNode("Hello")])), "CONTENT[ \'Hello\' ]\n");
});
});
});