add failing unit test for #510
This commit is contained in:
parent
15f2ef3f80
commit
cd271f1a8b
3 changed files with 12 additions and 1 deletions
|
|
@ -17,4 +17,6 @@ do ->
|
|||
heregex # comment
|
||||
///imgy
|
||||
this isnt: `just JavaScript`
|
||||
undefined
|
||||
undefined
|
||||
|
||||
sentence = "#{ 22 / 7 } is a decent approximation of π"
|
||||
|
|
@ -179,12 +179,14 @@ define(function(require, exports, module) {
|
|||
qstring : [{
|
||||
token : "string",
|
||||
regex : "[^\\\\']*(?:\\\\.[^\\\\']*)*'",
|
||||
merge : true,
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
qqstring : [{
|
||||
token : "string",
|
||||
regex : '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
|
||||
merge : true,
|
||||
next : "start"
|
||||
}, stringfill],
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,13 @@ module.exports = {
|
|||
var tokens = this.tokenizer.getLineTokens("for", "start").tokens;
|
||||
assert.equal(tokens.length, 1);
|
||||
assert.equal(tokens[0].type, "keyword");
|
||||
},
|
||||
|
||||
"test tokenize string with interpolation": function() {
|
||||
var tokens = this.tokenizer.getLineTokens('"#{ 22 / 7 } is a decent approximation of π"', "start").tokens;
|
||||
console.log(tokens);
|
||||
assert.equal(tokens.length, 12);
|
||||
//assert.equal(tokens[0].type, "keyword");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue