@@ -451,7 +451,7 @@ public class ExerciseZipEntry : ZipBase
451
451
{
452
452
void PiecewiseCompare ( ZipEntry lhs , ZipEntry rhs )
453
453
{
454
- // Introspection might be better here?
454
+ // Introspection would be better here of course
455
455
Assert . AreEqual ( lhs . Name , rhs . Name , "Cloned name mismatch" ) ;
456
456
Assert . AreEqual ( lhs . Crc , rhs . Crc , "Cloned crc mismatch" ) ;
457
457
Assert . AreEqual ( lhs . Comment , rhs . Comment , "Cloned comment mismatch" ) ;
@@ -2039,15 +2039,31 @@ public void ReadOverrunShort()
2039
2039
[ TestFixture ]
2040
2040
public class ExerciseZipNameTransform : ZipBase
2041
2041
{
2042
+ void TestFile ( ZipNameTransform t , string original , string expected )
2043
+ {
2044
+ string transformed = t . TransformFile ( original ) ;
2045
+ Assert . AreEqual ( expected , transformed , "Should be equal" ) ;
2046
+ }
2047
+
2042
2048
[ Test ]
2043
2049
[ Category ( "Zip" ) ]
2044
2050
public void Exercise ( )
2045
2051
{
2046
- ZipNameTransform nt = new ZipNameTransform ( ) ;
2052
+ ZipNameTransform t = new ZipNameTransform ( ) ;
2053
+
2054
+ TestFile ( t , "abcdef" , "abcdef" ) ;
2055
+ TestFile ( t , @"\\uncpath\d1\file1" , "file1" ) ;
2056
+ TestFile ( t , @"C:\absolute\file2" , "absolute/file2" ) ;
2057
+
2058
+ // This is ignored but could be converted to 'file3'
2059
+ TestFile ( t , @"./file3" , "./file3" ) ;
2047
2060
2048
- string original = "abcdefghijklmnopqrstuvwxyz" ;
2049
- string transformed = nt . TransformFile ( original ) ;
2050
- Assert . AreEqual ( original , transformed , "Should be equal" ) ;
2061
+ // The following relative paths cant be handled and are ignored
2062
+ TestFile ( t , @"../file3" , "../file3" ) ;
2063
+ TestFile ( t , @".../file3" , ".../file3" ) ;
2064
+
2065
+ // Trick filenames.
2066
+ TestFile ( t , @".....file3" , ".....file3" ) ;
2051
2067
}
2052
2068
}
2053
2069
[ TestFixture ]
@@ -2348,6 +2364,15 @@ public void Zip64Useage()
2348
2364
}
2349
2365
}
2350
2366
2367
+ [ Test ]
2368
+ [ Category ( "Zip" ) ]
2369
+ [ Explicit ]
2370
+ public void Zip64Offset ( )
2371
+ {
2372
+ // TODO: Test to check that a zip64 offset value is loaded correctly.
2373
+ // Changes in ZipEntry to CentralHeaderRequiresZip64 and LocalHeaderRequiresZip64
2374
+ // were not quite correct...
2375
+ }
2351
2376
2352
2377
[ Test ]
2353
2378
[ Category ( "Zip" ) ]
0 commit comments