@@ -350,10 +350,66 @@ test('RFC 6265 - character not allowed in the cookie-name "\\t"', function () {
350350test ( 'RFC 6265 - character not allowed in the cookie-name " "' , function ( ) {
351351 expect ( 2 ) ;
352352 Cookies . set ( ' ' , 'v' ) ;
353- strictEqual ( Cookies . get ( ' ' ) , 'v' , 'should handle whitespace character' ) ;
353+ strictEqual ( Cookies . get ( ' ' ) , 'v' , 'should handle the whitespace character' ) ;
354354 strictEqual ( document . cookie , '%20=v' , 'whitespace is not allowed, need to encode' ) ;
355355} ) ;
356356
357+ test ( 'RFC 6265 - character allowed in the cookie-name "#"' , function ( ) {
358+ expect ( 2 ) ;
359+ Cookies . set ( '#' , 'v' ) ;
360+ strictEqual ( Cookies . get ( '#' ) , 'v' , 'should handle the sharp character' ) ;
361+ strictEqual ( document . cookie , '#=v' , 'sharp is allowed, should not encode' ) ;
362+ } ) ;
363+
364+ test ( 'RFC 6265 - character allowed in the cookie-name "$"' , function ( ) {
365+ expect ( 2 ) ;
366+ Cookies . set ( '$' , 'v' ) ;
367+ strictEqual ( Cookies . get ( '$' ) , 'v' , 'should handle the dollar sign character' ) ;
368+ strictEqual ( document . cookie , '$=v' , 'dollar sign is allowed, should not encode' ) ;
369+ } ) ;
370+
371+ test ( 'RFC 6265 - character allowed in cookie-name "%"' , function ( ) {
372+ expect ( 2 ) ;
373+ Cookies . set ( '%' , 'v' ) ;
374+ strictEqual ( Cookies . get ( '%' ) , 'v' , 'should handle the percent character' ) ;
375+ strictEqual ( document . cookie , '%25=v' , 'percent is allowed, but need to be escaped' ) ;
376+ } ) ;
377+
378+ test ( 'RFC 6265 - character allowed in the cookie-name "&"' , function ( ) {
379+ expect ( 2 ) ;
380+ Cookies . set ( '&' , 'v' ) ;
381+ strictEqual ( Cookies . get ( '&' ) , 'v' , 'should handle the ampersand character' ) ;
382+ strictEqual ( document . cookie , '&=v' , 'ampersand is allowed, should not encode' ) ;
383+ } ) ;
384+
385+ test ( 'RFC 6265 - character allowed in the cookie-name "+"' , function ( ) {
386+ expect ( 2 ) ;
387+ Cookies . set ( '+' , 'v' ) ;
388+ strictEqual ( Cookies . get ( '+' ) , 'v' , 'should handle the plus character' ) ;
389+ strictEqual ( document . cookie , '+=v' , 'plus is allowed, should not encode' ) ;
390+ } ) ;
391+
392+ test ( 'RFC 6265 - character allowed in the cookie-name "^"' , function ( ) {
393+ expect ( 2 ) ;
394+ Cookies . set ( '^' , 'v' ) ;
395+ strictEqual ( Cookies . get ( '^' ) , 'v' , 'should handle the caret character' ) ;
396+ strictEqual ( document . cookie , '^=v' , 'caret is allowed, should not encode' ) ;
397+ } ) ;
398+
399+ test ( 'RFC 6265 - character allowed in the cookie-name "`"' , function ( ) {
400+ expect ( 2 ) ;
401+ Cookies . set ( '`' , 'v' ) ;
402+ strictEqual ( Cookies . get ( '`' ) , 'v' , 'should handle the grave accent character' ) ;
403+ strictEqual ( document . cookie , '`=v' , 'grave accent is allowed, should not encode' ) ;
404+ } ) ;
405+
406+ test ( 'RFC 6265 - character allowed in the cookie-name "|"' , function ( ) {
407+ expect ( 2 ) ;
408+ Cookies . set ( '|' , 'v' ) ;
409+ strictEqual ( Cookies . get ( '|' ) , 'v' , 'should handle the pipe character' ) ;
410+ strictEqual ( document . cookie , '|=v' , 'pipe is allowed, should not encode' ) ;
411+ } ) ;
412+
357413test ( 'cookie-name - 2 bytes characters' , function ( ) {
358414 expect ( 2 ) ;
359415
0 commit comments