Skip to content

Commit

Permalink
Expanded CLI test suite and fixed bug with validation of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-ward committed Oct 8, 2019
1 parent f73f32f commit decccaf
Show file tree
Hide file tree
Showing 3 changed files with 545 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dist/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ if (bounds !== null) {
if (bounds.length !== 4) {
raiseError("Bounds must be west,south,east,north. Invalid value found: ".concat((0, _toConsumableArray2["default"])(bounds)));
}

var _bounds = (0, _slicedToArray2["default"])(bounds, 4),
west = _bounds[0],
south = _bounds[1],
east = _bounds[2],
north = _bounds[3];

if (west === east) {
raiseError("Bounds west and east coordinate are the same value");
}

if (south === north) {
raiseError("Bounds south and north coordinate are the same value");
}
}

if (bearing !== null) {
Expand Down
7 changes: 7 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ if (bounds !== null) {
]}`
)
}
const [west, south, east, north] = bounds
if (west === east) {
raiseError(`Bounds west and east coordinate are the same value`)
}
if (south === north) {
raiseError(`Bounds south and north coordinate are the same value`)
}
}

if (bearing !== null) {
Expand Down
Loading

0 comments on commit decccaf

Please sign in to comment.