Tests for UTFGrid layer and control.

This commit is contained in:
Tim Schaub
2012-03-03 17:29:38 -07:00
parent dc4df928ed
commit 268b84286b
5 changed files with 246 additions and 5 deletions

View File

@@ -73,13 +73,15 @@
tile.parseData('{"foo": "bar"}');
t.eq(tile.json, {foo: "bar"}, "valid json parsed");
var err;
var err, obj;
try {
tile.parseData('foo bar');
obj = tile.parseData('foo bar');
} catch (e) {
err = e;
}
t.ok(err instanceof Error, "throws on invalid json");
// The JSON format doesn't actually throw on IE6, so we also check
// for undefined here.
t.ok(err instanceof Error || obj === undefined, "throws on invalid json");
tearDown();
}
@@ -215,7 +217,11 @@
});
}
function test_getFeatureId_demo(t) {
// While I dislike committing tests that aren't run, I'd like to make an
// exception here. This test (or something like it) should pass. When
// https://github.com/mapbox/utfgrid-spec/issues/1 is resolved, we should
// either modify this or update demo.json and enable the test.
function xtest_getFeatureId_demo(t) {
/**
* The UTFGrid 1.2 spec (https://github.com/mapbox/utfgrid-spec/blob/master/1.2/utfgrid.md)
* links to a demo.json to be used for testing implementations. This