Deindent post tapification.
This commit is contained in:
@@ -6,13 +6,13 @@ var MBTiles = require('..');
|
||||
var fixtureDir = __dirname + '/fixtures/output';
|
||||
var image = fs.readFileSync(__dirname + '/fixtures/images/plain_1_0_0_0.png');
|
||||
|
||||
tape('setup', function(assert) {
|
||||
tape('setup', function(assert) {
|
||||
// Recreate output directory to remove previous tests.
|
||||
try { fs.unlinkSync(fixtureDir + '/commit_1.mbtiles'); } catch(err) {}
|
||||
try { fs.mkdirSync(fixtureDir, 0755); } catch(err) {}
|
||||
assert.end();
|
||||
});
|
||||
tape('test mbtiles commit lock', function(assert) {
|
||||
});
|
||||
tape('test mbtiles commit lock', function(assert) {
|
||||
var remaining = 10;
|
||||
new MBTiles('mbtiles://' + fixtureDir + '/commit_1.mbtiles?batch=1', function(err, mbtiles) {
|
||||
assert.ifError(err, 'new MBTiles');
|
||||
@@ -27,4 +27,4 @@ var image = fs.readFileSync(__dirname + '/fixtures/images/plain_1_0_0_0.png');
|
||||
assert.ifError(err, 'putTile');
|
||||
if (!--remaining) assert.end();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,9 +8,9 @@ var fixtures = {
|
||||
empty: __dirname + '/fixtures/empty.mbtiles'
|
||||
};
|
||||
|
||||
try { fs.unlinkSync(fixtures.empty); } catch (err) {}
|
||||
try { fs.unlinkSync(fixtures.empty); } catch (err) {}
|
||||
|
||||
tape('get metadata', function(assert) {
|
||||
tape('get metadata', function(assert) {
|
||||
new MBTiles(fixtures.plain_1, function(err, mbtiles) {
|
||||
assert.ifError(err);
|
||||
|
||||
@@ -39,8 +39,8 @@ var fixtures = {
|
||||
assert.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
tape('get/put metadata from empty file', function(assert) {
|
||||
});
|
||||
tape('get/put metadata from empty file', function(assert) {
|
||||
var info = {
|
||||
version: '1.0.0',
|
||||
level1: { level2: 'property' },
|
||||
@@ -94,4 +94,4 @@ var fixtures = {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,12 +7,12 @@ var fixtures = {
|
||||
doesnotexist: __dirname + '/doesnotexist'
|
||||
};
|
||||
|
||||
try { fs.unlinkSync(fixtures.doesnotexist); } catch (err) {}
|
||||
try { fs.unlinkSync(fixtures.doesnotexist); } catch (err) {}
|
||||
|
||||
tape('list', function(assert) {
|
||||
tape('list', function(assert) {
|
||||
MBTiles.list(fixtures.doesnotexist, function(err, list) {
|
||||
assert.ifError(err);
|
||||
assert.deepEqual(list, {});
|
||||
assert.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,11 +22,11 @@ function yieldsError(assert, error, msg, callback) {
|
||||
};
|
||||
}
|
||||
|
||||
var loaded = {};
|
||||
var loaded = {};
|
||||
|
||||
try { fs.unlinkSync(fixtures.non_existent); } catch (err) {}
|
||||
try { fs.unlinkSync(fixtures.non_existent); } catch (err) {}
|
||||
|
||||
tape('setup', function(assert) {
|
||||
tape('setup', function(assert) {
|
||||
var queue = Object.keys(fixtures);
|
||||
var load = function() {
|
||||
if (!queue.length) return assert.end();
|
||||
@@ -38,9 +38,9 @@ function yieldsError(assert, error, msg, callback) {
|
||||
});
|
||||
};
|
||||
load();
|
||||
});
|
||||
});
|
||||
|
||||
fs.readdirSync(__dirname + '/fixtures/images/').forEach(function(file) {
|
||||
fs.readdirSync(__dirname + '/fixtures/images/').forEach(function(file) {
|
||||
var coords = file.match(/^plain_1_(\d+)_(\d+)_(\d+).png$/);
|
||||
if (!coords) return;
|
||||
|
||||
@@ -60,21 +60,21 @@ function yieldsError(assert, error, msg, callback) {
|
||||
tape('grid ' + coords.join('/'), function(assert) {
|
||||
loaded.plain_1.getGrid(coords[0] | 0, coords[1] | 0, coords[2] | 0, yieldsError(assert, 'error', 'Grid does not exist', assert.end));
|
||||
});
|
||||
});
|
||||
[ [0,1,0],
|
||||
});
|
||||
[ [0,1,0],
|
||||
[-1,0,0],
|
||||
[0,0,1],
|
||||
[3,1,-1],
|
||||
[2,-3,3],
|
||||
[18,2,262140],
|
||||
[4,0,15]
|
||||
].forEach(function(coords) {
|
||||
].forEach(function(coords) {
|
||||
tape('tile ' + coords.join('/'), function(assert) {
|
||||
loaded.plain_1.getTile(coords[0], coords[1], coords[2], yieldsError(assert, 'error', 'Tile does not exist', assert.end));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
fs.readdirSync(__dirname + '/fixtures/grids/').forEach(function(file) {
|
||||
fs.readdirSync(__dirname + '/fixtures/grids/').forEach(function(file) {
|
||||
var coords = file.match(/^plain_2_(\d+)_(\d+)_(\d+).json$/);
|
||||
if (!coords) return;
|
||||
|
||||
@@ -101,23 +101,23 @@ function yieldsError(assert, error, msg, callback) {
|
||||
assert.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
[ [0,1,0],
|
||||
});
|
||||
[ [0,1,0],
|
||||
[-1,0,0],
|
||||
[0,0,1],
|
||||
[3,1,-1],
|
||||
[2,-3,3],
|
||||
[18,2,262140],
|
||||
[4,0,15]
|
||||
].forEach(function(coords) {
|
||||
].forEach(function(coords) {
|
||||
tape('grid ' + coords.join('/'), function(assert) {
|
||||
loaded.plain_2.getGrid(coords[0], coords[1], coords[2], yieldsError(assert, 'error', 'Grid does not exist', assert.end));
|
||||
});
|
||||
tape('grid alt ' + coords.join('/'), function(assert) {
|
||||
loaded.plain_4.getGrid(coords[0], coords[1], coords[2], yieldsError(assert, 'error', 'Grid does not exist', assert.end));
|
||||
});
|
||||
});
|
||||
[ [0,1,0],
|
||||
});
|
||||
[ [0,1,0],
|
||||
[-1,0,0],
|
||||
[0,0,-1],
|
||||
[3,1,8],
|
||||
@@ -131,12 +131,12 @@ function yieldsError(assert, error, msg, callback) {
|
||||
[4,0,14],
|
||||
[3,0,7],
|
||||
[3,6,2]
|
||||
].forEach(function(coords) {
|
||||
].forEach(function(coords) {
|
||||
tape('dne ' + coords.join('/'), function(assert) {
|
||||
loaded.non_existent.getTile(coords[0], coords[1], coords[2], yieldsError(assert, 'error', 'Tile does not exist', assert.end));
|
||||
});
|
||||
tape('corrupt ' + coords.join('/'), function(assert) {
|
||||
loaded.corrupt.getTile(coords[0], coords[1], coords[2], yieldsError(assert, 'error', 'SQLITE_CORRUPT: database disk image is malformed', assert.end));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ var tape = require('tape');
|
||||
var MBTiles = require('..');
|
||||
var fixtureDir = __dirname + '/fixtures/output';
|
||||
|
||||
// Recreate output directory to remove previous tests.
|
||||
try { fs.unlinkSync(fixtureDir + '/write_1.mbtiles'); } catch(err) {}
|
||||
try { fs.mkdirSync(fixtureDir, 0755); } catch(err) {}
|
||||
// Recreate output directory to remove previous tests.
|
||||
try { fs.unlinkSync(fixtureDir + '/write_1.mbtiles'); } catch(err) {}
|
||||
try { fs.mkdirSync(fixtureDir, 0755); } catch(err) {}
|
||||
|
||||
tape('test mbtiles file creation', function(assert) {
|
||||
tape('test mbtiles file creation', function(assert) {
|
||||
var completed = { written: 0, read: 0 };
|
||||
new MBTiles(fixtureDir + '/write_1.mbtiles', function(err, mbtiles) {
|
||||
completed.open = true;
|
||||
@@ -59,4 +59,4 @@ var fixtureDir = __dirname + '/fixtures/output';
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,11 +5,11 @@ var tape = require('tape');
|
||||
var MBTiles = require('..');
|
||||
var fixtureDir = __dirname + '/fixtures/output';
|
||||
|
||||
// Recreate output directory to remove previous tests.
|
||||
try { fs.unlinkSync(fixtureDir + '/write_2.mbtiles'); } catch(err) {}
|
||||
try { fs.mkdirSync(fixtureDir, 0755); } catch(err) {}
|
||||
// Recreate output directory to remove previous tests.
|
||||
try { fs.unlinkSync(fixtureDir + '/write_2.mbtiles'); } catch(err) {}
|
||||
try { fs.mkdirSync(fixtureDir, 0755); } catch(err) {}
|
||||
|
||||
tape('test mbtiles file creation', function(assert) {
|
||||
tape('test mbtiles file creation', function(assert) {
|
||||
var completed = { written: 0, read: 0 };
|
||||
new MBTiles(fixtureDir + '/write_2.mbtiles', function(err, mbtiles) {
|
||||
completed.open = true;
|
||||
@@ -59,4 +59,4 @@ var fixtureDir = __dirname + '/fixtures/output';
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user