Escaping key value interpolation #1
This commit is contained in:
parent
3a69f3bd20
commit
8d65af5ff7
2 changed files with 23 additions and 6 deletions
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue