From 38bfdf0c72aec6673a1254029d8cfbf867d1ee41 Mon Sep 17 00:00:00 2001 From: thegrandpoobah Date: Mon, 31 Jan 2011 15:05:02 -0500 Subject: [PATCH] Unit Test for Issue #79 --- test/unit.compiler.js | 18 ++++++++++++++++++ test/unit.interpreter.js | 20 +++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/test/unit.compiler.js b/test/unit.compiler.js index 7f98d73..ac7460a 100644 --- a/test/unit.compiler.js +++ b/test/unit.compiler.js @@ -685,4 +685,22 @@ test("Regression Suite", function() { 'mustache is awesome!', 'Issue 46' ); + + // matches Issue #79 + equals( + Mustache.to_html( + '{{#inner}}{{f}}{{#inner}}{{b}}{{/inner}}{{/inner}}' + , { + inner: [{ + f: 'foo' + , inner: [{ + b: 'bar' + }] + }] + } + , {} + ) + , 'foobar' + , 'Nested Sections with the same name' + ); }); diff --git a/test/unit.interpreter.js b/test/unit.interpreter.js index 4633c2d..18c5360 100644 --- a/test/unit.interpreter.js +++ b/test/unit.interpreter.js @@ -588,7 +588,7 @@ test("Demo", function() { }); test("Regression Suite", function() { - expect(3); + expect(4); // matches bug_11_eating_whitespace.html equals( @@ -622,4 +622,22 @@ test("Regression Suite", function() { 'mustache is awesome!', 'Issue 46' ); + + // matches Issue #79 + equals( + Mustache.to_html( + '{{#inner}}{{f}}{{#inner}}{{b}}{{/inner}}{{/inner}}' + , { + inner: [{ + f: 'foo' + , inner: [{ + b: 'bar' + }] + }] + } + , {} + ) + , 'foobar' + , 'Nested Sections with the same name' + ); });