Bladeren bron

Unit Tests for comment ending tag (Compiler Version)

tags/0.5.0-vsc
Sahab Yazdani 15 jaren geleden
bovenliggende
commit
ba8c7d39b6
1 gewijzigde bestanden met toevoegingen van 17 en 2 verwijderingen
  1. +17
    -2
      test/unit.compiler.js

+ 17
- 2
test/unit.compiler.js Bestand weergeven

@@ -403,12 +403,27 @@ test("'=' (Set Delimiter)", function() {
}); });


test("'!' (Comments)", 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 // matches comments.html
equals( equals(
Mustache.to_html( Mustache.to_html(
'<h1>{{title}}{{! just something interesting... or not... }}</h1>\n',
'<h1>{{title}}{{! just something interesting... or not... !}}</h1>\n',
{ {
title: function() { title: function() {
return "A Comedy of Errors"; return "A Comedy of Errors";


Laden…
Annuleren
Opslaan