mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Test nodeIntersect
This commit is contained in:
@@ -35,6 +35,22 @@ describe('Util', function() {
|
||||
expect(iD.util.geo.interp(a, b, 0)).to.eql({ lat: 0, lon: 0});
|
||||
});
|
||||
});
|
||||
describe('#nodeIntersect', function() {
|
||||
it('correctly says that a node is in an extent', function() {
|
||||
expect(iD.util.geo.nodeIntersect({
|
||||
lat: 0, lon: 0
|
||||
}, [
|
||||
[-180, 90],
|
||||
[180, -90]])).to.be.true;
|
||||
});
|
||||
it('correctly says that a node is outside of an extent', function() {
|
||||
expect(iD.util.geo.nodeIntersect({
|
||||
lat: 0, lon: 0
|
||||
}, [
|
||||
[100, 90],
|
||||
[180, -90]])).to.be.false;
|
||||
});
|
||||
});
|
||||
describe('#dist', function() {
|
||||
it('distance between two same points is zero', function() {
|
||||
var a = [0, 0],
|
||||
|
||||
Reference in New Issue
Block a user