Skip to content

Commit 73478fe

Browse files
Add test for global replace of parens
1 parent 13f5145 commit 73478fe

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/encoding.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ test('RFC 6265 - character not allowed in the cookie-name ")"', function () {
235235
strictEqual(document.cookie, '%29=v', 'closing parens is not allowed, need to encode');
236236
});
237237

238+
test('RFC 6265 - should replace parens globally', function () {
239+
expect(1);
240+
Cookies.set('(())', 'v');
241+
strictEqual(document.cookie, '%28%28%29%29=v', 'encode with global replace');
242+
});
243+
238244
test('RFC 6265 - character not allowed in the cookie-name "<"', function () {
239245
expect(2);
240246
Cookies.set('<', 'v');

0 commit comments

Comments
 (0)