Show
Ignore:
Timestamp:
04/29/10 14:01:30 (2 years ago)
Author:
Menno Smits <menno@…>
Branch:
default
Message:

Correctly handle \" in quoted strings.

(As reported in comments of #28)

It turns out these were being handled twice causing them to be
incorrectly removed if a string started with a double quote.

Extended tests to cover more cases around escaped double quotes. Prior
to this the test weren't covering enough cases.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • imapclient/test/test_IMAPClient.py

    r135 r142  
    9292                                                 r'(\HasNoChildren) "/" "Left\"Right"', 
    9393                                                 r'(\HasNoChildren) "/" "Left\\Right"', 
     94                                                 r'(\HasNoChildren) "/" "\"Left Right\""', 
     95                                                 r'(\HasNoChildren) "/" "\"Left\\Right\""', 
    9496                                                 ]) 
    9597        self.assertEqual(folders, [(['\\HasNoChildren'], '/', 'Test "Folder"'), 
    9698                                   (['\\HasNoChildren'], '/', 'Left\"Right'), 
    97                                    (['\\HasNoChildren'], '/', r'Left\Right')]) 
     99                                   (['\\HasNoChildren'], '/', r'Left\Right'), 
     100                                   (['\\HasNoChildren'], '/', r'"Left Right"'), 
     101                                   (['\\HasNoChildren'], '/', r'"Left\Right"'), 
     102                                   ]) 
    98103 
    99104    def test_empty_response(self):