Skip to content

Commit

Permalink
windows tweaks to unicode tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Jan 17, 2013
1 parent 912b9af commit 09dfe46
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions test/data/ééé/foo.csv
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
x,y
0,0
Binary file added test/data/ééé/foo.csv.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions test/unicode.test.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ describe('Handling unicode paths, filenames, and data', function(){
var zf = new zipfile.ZipFile(zippath); var zf = new zipfile.ZipFile(zippath);
assert.equal(zf.count, 3); assert.equal(zf.count, 3);
var buffer = zf.readFileSync(zf.names[0]); var buffer = zf.readFileSync(zf.names[0]);
assert.equal(buffer.toString('utf8'),fs.readFileSync(zippath.replace('.zip','')).toString('utf8')); assert.equal(buffer.toString('utf8'),fs.readFileSync(zippath.replace('.zip','')).toString('utf8').replace(/\r/g,''));
}); });


it('open zip with folder and file with unicode', function(){ it('open zip with folder and file with unicode', function(){
var zippath = './test/data/Clément/Olá.txt.zip'; var zippath = './test/data/Clément/Olá.zip';
assert.ok(existsSync(zippath)); assert.ok(existsSync(zippath));
var zf = new zipfile.ZipFile(zippath); var zf = new zipfile.ZipFile(zippath);
assert.equal(zf.count, 1); assert.equal(zf.count, 1);
}); });


it('open zip with unicode paths and unicode filenames in archive', function(){ it('open zip with unicode paths and unicode filenames in archive', function(){
var zippath = './test/data/Clément/Olá.txt.zip'; var zippath = './test/data/Clément/Olá.zip';
assert.ok(existsSync(zippath)); assert.ok(existsSync(zippath));
var zf = new zipfile.ZipFile(zippath); var zf = new zipfile.ZipFile(zippath);
assert.equal(zf.count, 1); assert.equal(zf.count, 1);
Expand All @@ -41,7 +41,7 @@ describe('Handling unicode paths, filenames, and data', function(){
assert.equal(zf.count, 3); assert.equal(zf.count, 3);
assert.deepEqual(zf.names, ["你好_points.csv","__MACOSX/","__MACOSX/._你好_points.csv"]); assert.deepEqual(zf.names, ["你好_points.csv","__MACOSX/","__MACOSX/._你好_points.csv"]);
var buffer = zf.readFileSync(zf.names[0]); var buffer = zf.readFileSync(zf.names[0]);
assert.equal(buffer.toString('utf8'),fs.readFileSync('./test/data/你好_points.csv').toString('utf8')); assert.equal(buffer.toString('utf8'),fs.readFileSync('./test/data/你好_points.csv').toString('utf8').replace(/\r/g,''));
}); });


}); });

0 comments on commit 09dfe46

Please sign in to comment.