From bff6686bd418ea04541b3a3c88faa6a17ddc57d5 Mon Sep 17 00:00:00 2001 From: Sahab Yazdani Date: Tue, 12 Oct 2010 19:58:48 -0700 Subject: [PATCH] Unit Tests for comment ending tag (Interpreter Version) --- test/unit.interpreter.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/unit.interpreter.js b/test/unit.interpreter.js index 0f429b6..c2046d0 100644 --- a/test/unit.interpreter.js +++ b/test/unit.interpreter.js @@ -385,12 +385,27 @@ test("'=' (Set Delimiter)", function() { }); test("'!' (Comments)", function() { - expect(1); + expect(4); + equals( + Mustache.to_html('{{! this is a single line comment !}}'), + '', + 'Single Line Comments'); + + equals( + Mustache.to_html('{{!this is a multiline comment\ni said this is a multiline comment!}}'), + '', + 'Multiline Comments'); + + equals( + Mustache.to_html('{{!this {{is}} {{#a}} {{/multiline}} comment\ni {{^said}} ! hello !! bye!}}'), + '', + 'Correct tokenization'); + // matches comments.html equals( Mustache.to_html( - '

{{title}}{{! just something interesting... or not... }}

\n', + '

{{title}}{{! just something interesting... or not... !}}

\n', { title: function() { return "A Comedy of Errors";