Escaping key value interpolation #1

This commit is contained in:
Ziang Song 2014-07-17 10:22:35 -04:00
commit 8d65af5ff7
2 changed files with 23 additions and 6 deletions

View file

@ -72,4 +72,18 @@ describe('Kiwi.compose - %{}', function() {
var output = "The quick brown jumps over the lazy dog.";
expect(Kiwi.compose(input, dic)).toEqual(output);
});
it('should escape key value interpolation if ` is given before %',function() {
var input = "The quick brown `%{f} jumps over the lazy dog.";
var dic = {"d": "dog"};
var output = "The quick brown %{f} jumps over the lazy dog.";
expect(Kiwi.compose(input, dic)).toEqual(output);
});
it('should escape key value interpolation for the first case but not for the 2nd.',function() {
var input = "The quick brown `%{f} %{f} jumps over the lazy dog.";
var dic = {"f": "fox"};
var output = "The quick brown %{f} fox jumps over the lazy dog.";
expect(Kiwi.compose(input, dic)).toEqual(output);
});
});