-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from crazycapivara/feature/inspection
Feature/inspection
- Loading branch information
Showing
9 changed files
with
152 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: h3 | ||
Title: R bindings for H3 | ||
Version: 3.3.0 | ||
Date: 2019-02-17 | ||
Version: 3.3.1 | ||
Date: 2019-03-08 | ||
Authors@R: person("Stefan","Kuethe", role = c("aut", "cre"), email = "[email protected]") | ||
Maintainer: Stefan Kuethe <[email protected]> | ||
Description: Provides R bindings for H3 <https://uber.github.io/h3/>, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
context("inspection") | ||
|
||
test_that("is pentagon", { | ||
# Prepare | ||
all_indexes <- road_safety_greater_manchester[1, ] %>% | ||
geo_to_h3(0) %>% | ||
k_ring(10) | ||
|
||
# Act | ||
is_pentagon <- h3_is_pentagon(all_indexes) | ||
|
||
# Assert | ||
expect_length(is_pentagon, 122) | ||
expect_equal(sum(is_pentagon), 8) | ||
}) | ||
|
||
test_that("is res class III", { | ||
# Prepare | ||
indexes_res_0 <- road_safety_greater_manchester[1, ] %>% | ||
geo_to_h3(0) %>% | ||
k_ring() | ||
indexes_res_1 <- road_safety_greater_manchester[1, ] %>% | ||
geo_to_h3(1) %>% | ||
k_ring() | ||
|
||
# Act | ||
is_res_class_iii_0 <- h3_is_res_class_iii(indexes_res_0) | ||
is_res_class_iii_1 <- h3_is_res_class_iii(indexes_res_1) | ||
|
||
# Assert | ||
expect_false(all(is_res_class_iii_0)) | ||
expect_true(all(is_res_class_iii_1)) | ||
}) |