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