summaryrefslogtreecommitdiffstats
path: root/spec/tokenizer.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/tokenizer.js')
-rw-r--r--spec/tokenizer.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/tokenizer.js b/spec/tokenizer.js
index f170704..dc077ce 100644
--- a/spec/tokenizer.js
+++ b/spec/tokenizer.js
@@ -241,6 +241,15 @@ describe('Tokenizer', function() {
shouldMatchTokens(result, ['OPEN_BLOCK', 'ID', 'CLOSE', 'CONTENT', 'OPEN_ENDBLOCK', 'ID', 'CLOSE']);
});
+ it('tokenizes directives', function() {
+ shouldMatchTokens(
+ tokenize('{{#*foo}}content{{/foo}}'),
+ ['OPEN_BLOCK', 'ID', 'CLOSE', 'CONTENT', 'OPEN_ENDBLOCK', 'ID', 'CLOSE']);
+ shouldMatchTokens(
+ tokenize('{{*foo}}'),
+ ['OPEN', 'ID', 'CLOSE']);
+ });
+
it('tokenizes inverse sections as "INVERSE"', function() {
shouldMatchTokens(tokenize('{{^}}'), ['INVERSE']);
shouldMatchTokens(tokenize('{{else}}'), ['INVERSE']);