Fixing tests properly, as suggested by @sbrunner
This commit is contained in:
+7
-7
@@ -315,7 +315,7 @@
|
|||||||
for (var i=0; i<expectedResolutions.length; ++i) {
|
for (var i=0; i<expectedResolutions.length; ++i) {
|
||||||
got = layer.resolutions[i];
|
got = layer.resolutions[i];
|
||||||
exp = expectedResolutions[i];
|
exp = expectedResolutions[i];
|
||||||
if (got.toFixed(3) !== exp.toFixed(3)) {
|
if (got.toFixed(10) !== exp.toFixed(10)) {
|
||||||
t.fail(id + ": bad resolutions - index " + i + " got " + got + " but expected " + exp);
|
t.fail(id + ": bad resolutions - index " + i + " got " + got + " but expected " + exp);
|
||||||
same = false;
|
same = false;
|
||||||
break;
|
break;
|
||||||
@@ -325,11 +325,11 @@
|
|||||||
t.ok(true, id + ": correct resolutions");
|
t.ok(true, id + ": correct resolutions");
|
||||||
}
|
}
|
||||||
t.eq(
|
t.eq(
|
||||||
layer.maxResolution.toFixed(3), expectedMaxResolution.toFixed(3),
|
layer.maxResolution, expectedMaxResolution,
|
||||||
id + ": maxResolution set"
|
id + ": maxResolution set"
|
||||||
);
|
);
|
||||||
t.eq(
|
t.eq(
|
||||||
layer.minResolution.toFixed(3), expectedMinResolution.toFixed(3),
|
layer.minResolution, expectedMinResolution,
|
||||||
id + ": minResolution set"
|
id + ": minResolution set"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -400,13 +400,13 @@
|
|||||||
[0.0012699126752168362, 0.0006349563376084181, 0.00031747816880420905], 0.00031747816880420905, 0.0012699126752168362
|
[0.0012699126752168362, 0.0006349563376084181, 0.00031747816880420905], 0.00031747816880420905, 0.0012699126752168362
|
||||||
], [
|
], [
|
||||||
"1.18", null, {scales: [400000, 200000, 100000], units: "m"},
|
"1.18", null, {scales: [400000, 200000, 100000], units: "m"},
|
||||||
[141.11103491115225, 70.55551745557612, 35.27775872778806], 35.27775872778806, 141.11103491115225
|
[141.11139333389778, 70.55569666694889, 35.277848333474445], 35.277848333474445, 141.11139333389778
|
||||||
], [
|
], [
|
||||||
"1.19", null, {minScale: 400000, numZoomLevels: 3, units: "m"},
|
"1.19", null, {minScale: 400000, numZoomLevels: 3, units: "m"},
|
||||||
[141.11103491115225, 70.55551745557612, 35.27775872778806], 35.27775872778806, 141.11103491115225
|
[141.11139333389778, 70.55569666694889, 35.277848333474445], 35.277848333474445, 141.11139333389778
|
||||||
], [
|
], [
|
||||||
"1.20", null, {maxScale: 100000, numZoomLevels: 3, units: "m"},
|
"1.20", null, {maxScale: 100000, numZoomLevels: 3, units: "m"},
|
||||||
[141.11103491115225, 70.55551745557612, 35.27775872778806], 35.27775872778806, 141.11103491115225
|
[141.11139333389778, 70.55569666694889, 35.277848333474445], 35.277848333474445, 141.11139333389778
|
||||||
], [
|
], [
|
||||||
"1.21", null, {numZoomLevels: 2}, // maxResolution calculated based on the projection's maxExtent here
|
"1.21", null, {numZoomLevels: 2}, // maxResolution calculated based on the projection's maxExtent here
|
||||||
[1.40625, 0.703125], 0.703125, 1.40625
|
[1.40625, 0.703125], 0.703125, 1.40625
|
||||||
@@ -519,7 +519,7 @@
|
|||||||
[0.0012699126752168362, 0.0006349563376084181, 0.00031747816880420905], 0.00031747816880420905, 0.0012699126752168362
|
[0.0012699126752168362, 0.0006349563376084181, 0.00031747816880420905], 0.00031747816880420905, 0.0012699126752168362
|
||||||
], [
|
], [
|
||||||
"2.5.4", {units: "m"}, {scales: [400000, 200000, 100000]},
|
"2.5.4", {units: "m"}, {scales: [400000, 200000, 100000]},
|
||||||
[141.11103491115225, 70.55551745557612, 35.27775872778806], 35.27775872778806, 141.11103491115225
|
[141.11139333389778, 70.55569666694889, 35.277848333474445], 35.277848333474445, 141.11139333389778
|
||||||
], [
|
], [
|
||||||
/*
|
/*
|
||||||
* Batch 2.6: minScale set in the layer options
|
* Batch 2.6: minScale set in the layer options
|
||||||
|
|||||||
Reference in New Issue
Block a user