add failing unit test for #510

This commit is contained in:
Fabian Jakobs 2011-11-28 17:38:58 +01:00
commit cd271f1a8b
3 changed files with 12 additions and 1 deletions

View file

@ -17,4 +17,6 @@ do ->
heregex # comment
///imgy
this isnt: `just JavaScript`
undefined
undefined
sentence = "#{ 22 / 7 } is a decent approximation of π"

View file

@ -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],

View file

@ -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");
}
};