Bläddra i källkod

Add Unit Tests for format function.

tags/0.5.2-vsc
Sahab Yazdani 14 år sedan
förälder
incheckning
0ed087d3e0
1 ändrade filer med 20 tillägg och 0 borttagningar
  1. +20
    -0
      test/unit.js

+ 20
- 0
test/unit.js Visa fil

@@ -789,4 +789,24 @@ test("Regression Suite", function() {
)
, ' Hello '
, 'Change Delimiter + Partial');
});

test("Mustache.format", function() {
equals(
Mustache.format('{{0}} {{1}}, {{2}} {{3}}.', 'And', 'it', 'was', 'good'),
'And it, was good.',
'Simple Version'
);
equals(
Mustache.format('{{0}}', function() { return 'Groucho Marx'; } ),
'Groucho Marx',
'With Functions'
);
equals(
Mustache.format('{{0}}'),
'',
'Insufficient parameters (no failure)'
);
});

Laddar…
Avbryt
Spara