It should parse a token value
enum tpl = "{{value}}"; auto range = TokenRange(tpl); range.front.should.equal(Token(Token.Type.value, "value", Properties("")));
It should parse an helper token
enum tpl = "{{helper value}}"; auto range = TokenRange(tpl); range.front.should.equal(Token(Token.Type.helper, "helper", Properties("value")));
It should parse block tokens
enum tpl = "{{#if condition}}{{else}}{{/if}}"; auto range = TokenRange(tpl); range.array.should.equal([ Token(Token.Type.openBlock, "if", Properties("condition")), Token(Token.Type.value, "else", Properties("")), Token(Token.Type.closeBlock, "if", Properties(""))]);
It should parse two value tokens
enum tpl = "{{value1}}{{value2}}"; auto range = TokenRange(tpl); range.array.should.equal([ Token(Token.Type.value, "value1", Properties("")), Token(Token.Type.value, "value2", Properties(""))]);
It should parse value and text tokens
enum tpl = "1{{value1}}2{{value2}}3"; auto range = TokenRange(tpl); range.array.should.equal([ Token(Token.Type.plain, "1", Properties("")), Token(Token.Type.value, "value1", Properties("")), Token(Token.Type.plain, "2", Properties("")), Token(Token.Type.value, "value2", Properties("")), Token(Token.Type.plain, "3", Properties(""))]);
split the input into tokens