diff options
Diffstat (limited to 'spec/frontend/locale/sprintf_spec.js')
-rw-r--r-- | spec/frontend/locale/sprintf_spec.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/frontend/locale/sprintf_spec.js b/spec/frontend/locale/sprintf_spec.js index e0d0e117ea4..a7e245e2b78 100644 --- a/spec/frontend/locale/sprintf_spec.js +++ b/spec/frontend/locale/sprintf_spec.js @@ -84,5 +84,16 @@ describe('locale', () => { expect(output).toBe('contains duplicated 15%'); }); }); + + describe('ignores special replacements in the input', () => { + it.each(['$$', '$&', '$`', `$'`])('replacement "%s" is ignored', (replacement) => { + const input = 'My odd %{replacement} is preserved'; + + const parameters = { replacement }; + + const output = sprintf(input, parameters, false); + expect(output).toBe(`My odd ${replacement} is preserved`); + }); + }); }); }); |