tests/test-hybridencode.py
changeset 17440 5be041254a2e
parent 17432 61bd77b57c86
child 17444 d527ac9f011d
equal deleted inserted replaced
17439:fbb732a8f2b9 17440:5be041254a2e
    99 
    99 
   100 print "changing one char in part that's hashed away produces a different hash"
   100 print "changing one char in part that's hashed away produces a different hash"
   101 show('data/123456789-123456789-123456789-123456789-123456789-'
   101 show('data/123456789-123456789-123456789-123456789-123456789-'
   102           'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxy-'
   102           'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxy-'
   103           '123456789-123456')
   103           '123456789-123456')
       
   104 
       
   105 print "uppercase hitting length limit due to encoding"
       
   106 show('data/A23456789-123456789-123456789-123456789-123456789-'
       
   107           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   108           '123456789-12345')
       
   109 show('data/Z23456789-123456789-123456789-123456789-123456789-'
       
   110           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   111           '123456789-12345')
       
   112 
       
   113 print "compare with lowercase not hitting limit"
       
   114 show('data/a23456789-123456789-123456789-123456789-123456789-'
       
   115           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   116           '123456789-12345')
       
   117 show('data/z23456789-123456789-123456789-123456789-123456789-'
       
   118           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   119           '123456789-12345')
       
   120 
       
   121 print "not hitting limit with any of these"
       
   122 show("data/abcdefghijklmnopqrstuvwxyz0123456789 !#%&'()+,-.;="
       
   123           "[]^`{}xxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-"
       
   124           "123456789-12345")
       
   125 
       
   126 print "underbar hitting length limit due to encoding"
       
   127 show('data/_23456789-123456789-123456789-123456789-123456789-'
       
   128           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   129           '123456789-12345')
       
   130 
       
   131 print "tilde hitting length limit due to encoding"
       
   132 show('data/~23456789-123456789-123456789-123456789-123456789-'
       
   133           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   134           '123456789-12345')
       
   135 
       
   136 print "Windows reserved characters hitting length limit"
       
   137 show('data/<23456789-123456789-123456789-123456789-123456789-'
       
   138           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   139           '123456789-12345')
       
   140 show('data/>23456789-123456789-123456789-123456789-123456789-'
       
   141           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   142           '123456789-12345')
       
   143 show('data/:23456789-123456789-123456789-123456789-123456789-'
       
   144           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   145           '123456789-12345')
       
   146 show('data/"23456789-123456789-123456789-123456789-123456789-'
       
   147           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   148           '123456789-12345')
       
   149 show('data/\\23456789-123456789-123456789-123456789-123456789-'
       
   150           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   151           '123456789-12345')
       
   152 show('data/|23456789-123456789-123456789-123456789-123456789-'
       
   153           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   154           '123456789-12345')
       
   155 show('data/?23456789-123456789-123456789-123456789-123456789-'
       
   156           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   157           '123456789-12345')
       
   158 show('data/*23456789-123456789-123456789-123456789-123456789-'
       
   159           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   160           '123456789-12345')
       
   161 
       
   162 print "initial space hitting length limit"
       
   163 show('data/ 23456789-123456789-123456789-123456789-123456789-'
       
   164           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   165           '123456789-12345')
       
   166 
       
   167 print "initial dot hitting length limit"
       
   168 show('data/.23456789-123456789-123456789-123456789-123456789-'
       
   169           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   170           '123456789-12345')
       
   171 
       
   172 print "trailing space in filename hitting length limit"
       
   173 show('data/123456789-123456789-123456789-123456789-123456789-'
       
   174           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   175           '123456789-1234 ')
       
   176 
       
   177 print "trailing dot in filename hitting length limit"
       
   178 show('data/123456789-123456789-123456789-123456789-123456789-'
       
   179           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   180           '123456789-1234.')
       
   181 
       
   182 print "initial space in directory hitting length limit"
       
   183 show('data/ x/456789-123456789-123456789-123456789-123456789-'
       
   184           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   185           '123456789-12345')
       
   186 
       
   187 print "initial dot in directory hitting length limit"
       
   188 show('data/.x/456789-123456789-123456789-123456789-123456789-'
       
   189           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   190           '123456789-12345')
       
   191 
       
   192 print "trailing space in directory hitting length limit"
       
   193 show('data/x /456789-123456789-123456789-123456789-123456789-'
       
   194           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   195           '123456789-12345')
       
   196 
       
   197 print "trailing dot in directory hitting length limit"
       
   198 show('data/x./456789-123456789-123456789-123456789-123456789-'
       
   199           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   200           '123456789-12345')
       
   201 
       
   202 print "with directories that need direncoding, hitting length limit"
       
   203 show('data/x.i/56789-123456789-123456789-123456789-123456789-'
       
   204           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   205           '123456789-12345')
       
   206 show('data/x.d/56789-123456789-123456789-123456789-123456789-'
       
   207           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   208           '123456789-12345')
       
   209 show('data/x.hg/5789-123456789-123456789-123456789-123456789-'
       
   210           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   211           '123456789-12345')
       
   212 
       
   213 print "Windows reserved filenames, hitting length limit"
       
   214 show('data/con/56789-123456789-123456789-123456789-123456789-'
       
   215           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   216           '123456789-12345')
       
   217 show('data/prn/56789-123456789-123456789-123456789-123456789-'
       
   218           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   219           '123456789-12345')
       
   220 show('data/aux/56789-123456789-123456789-123456789-123456789-'
       
   221           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   222           '123456789-12345')
       
   223 show('data/nul/56789-123456789-123456789-123456789-123456789-'
       
   224           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   225           '123456789-12345')
       
   226 show('data/com1/6789-123456789-123456789-123456789-123456789-'
       
   227           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   228           '123456789-12345')
       
   229 show('data/com9/6789-123456789-123456789-123456789-123456789-'
       
   230           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   231           '123456789-12345')
       
   232 show('data/lpt1/6789-123456789-123456789-123456789-123456789-'
       
   233           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   234           '123456789-12345')
       
   235 show('data/lpt9/6789-123456789-123456789-123456789-123456789-'
       
   236           'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   237           '123456789-12345')
       
   238 
       
   239 print "non-reserved names, just not hitting limit"
       
   240 show('data/123456789-123456789-123456789-123456789-123456789-'
       
   241           '/com/com0/lpt/lpt0/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-'
       
   242           '123456789-12345')