diff --git a/test/unit.js b/test/unit.js index d5c6801..b8b9e4d 100644 --- a/test/unit.js +++ b/test/unit.js @@ -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)' + ); }); \ No newline at end of file