Permalink
Browse files

add tests for non-ascii characters in paths to datasources

  • Loading branch information...
1 parent d67a74a commit d1e81d88b4343cd23a13a1b0a5b3e0ebabe37731 Dane Springmeyer committed Jan 18, 2013
@@ -0,0 +1,2 @@
+x,y
+0,0
Binary file not shown.
@@ -0,0 +1 @@
+GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
+x,y,bigint
+0,0,2147483648
+0,0,9223372036854775807
View
Binary file not shown.
@@ -0,0 +1 @@
+GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
View
Binary file not shown.
View
Binary file not shown.
@@ -0,0 +1,36 @@
+var mapnik = require('mapnik');
+var assert = require('assert');
+var fs = require('fs');
+var existsSync = require('fs').existsSync || require('path').existsSync;
+
+describe('Handling unicode paths, filenames, and data', function(){
+
+ it('open csv from folder with unicode', function(){
+ var filepath = './test/data/Clément/foo.csv';
+ assert.ok(existsSync(filepath));
+ var ds = new mapnik.Datasource({type:'csv',file:filepath});
+ assert.ok(ds);
+ });
+
+ it('open shape from folder with unicode', function(){
+ var filepath = './test/data/Clément/long_lat.shp';
+ assert.ok(existsSync(filepath));
+ var ds = new mapnik.Datasource({type:'shape',file:filepath});
+ assert.ok(ds);
+ });
+
+ it('open csv file with unicode name', function(){
+ var filepath = './test/data/你好_points.csv';
+ assert.ok(existsSync(filepath));
+ var ds = new mapnik.Datasource({type:'csv',file:filepath});
+ assert.ok(ds);
+ });
+
+ it('open shape file with unicode name', function(){
+ var filepath = './test/data/你好_points.shp';
+ assert.ok(existsSync(filepath));
+ var ds = new mapnik.Datasource({type:'shape',file:filepath});
+ assert.ok(ds);
+ });
+
+});

0 comments on commit d1e81d8

Please sign in to comment.