Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-rohan-NOAA committed Dec 19, 2023
1 parent c65955d commit 31abe72
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
akgfmaps 3.4.1 (December 18, 2023)
akgfmaps 3.4.1 (December 19, 2023)
----------------------------------------------------------------

FUNCTIONALITY CHANGES
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-auto-mapping.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ testthat::test_that("Test auto-mapping functions interpolation",
xmax = test_map$map_layers$plot.boundary$x[2],
ymin = test_map$map_layers$plot.boundary$y[1],
ymax = test_map$map_layers$plot.boundary$y[2],
vals = rnorm(1e4)),
vals = rnorm(1e4),
crs = test_map$map_layers$crs$input),
amask = test_map$map_layers$survey.area);
expect_equal(test_map$n.breaks[1], 6);
expect_true(length(test_labs$map_layers$place.labels) > 2);
Expand Down
13 changes: 5 additions & 8 deletions tests/testthat/test-get-layers.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ testthat::test_that("Test get survey bathymetry ",
{expect_true(class(get_survey_bathymetry(select.region = "ebs", set.crs = "auto"))[1] == "sf")})

testthat::test_that("Test Bering Sea grid filtering",
{bs_south <- akgfmaps::get_base_layers(select.region = "bs.south",
set.crs = "auto");
bs_south_survey_grid <- suppressWarnings(akgfmaps::get_base_layers(select.region = "bs.south",
{bs_south <- suppressWarnings(akgfmaps::get_base_layers(select.region = "bs.south",
set.crs = "auto"));
bs_north <- suppressWarnings(akgfmaps::get_base_layers(select.region = "nbs",
set.crs = "auto"));
bs_north_survey_grid <- suppressWarnings(akgfmaps::get_base_layers(select.region = "nbs",
set.crs = "auto"));
expect_equal(length(bs_south$survey.grid$geometry), 376);
expect_equal(length(bs_north_survey_grid$survey.grid$geometry), 144);
expect_equal(length(bs_south_survey_grid$survey.grid$geometry), 376)})
expect_equal(length(bs_north$survey.grid$geometry), 144);
expect_equal(length(bs_south$survey.grid$geometry), 376)})
6 changes: 4 additions & 2 deletions tests/testthat/test-utilities.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
library(akgfmaps)

testthat::test_that("Test data frame CRS transformation",
{expect_match(akgfmaps::transform_data_frame_crs(data.frame(x = -170, y = 54, set.crs = "EPSG:3338"))$set.crs, "EPSG:3338")})
{expect_match(akgfmaps::transform_data_frame_crs(data.frame(x = -170, y = 54, set.crs = "EPSG:3338"),
in.crs = "EPSG:4326",
out.crs = "EPSG:3338")$set.crs, "EPSG:3338")})

testthat::test_that("Check breaks function",
{expect_equal(ncol(akgfmaps::eval_plot_breaks(CPUE = 1:20, n.breaks = 4, styles = "quantile")), 6)})

testthat::test_that("Test normal score transformations",
{expect_equal(suppressWarnings(akgfmaps:::backtransform_normal(scores = akgfmaps:::normal_transform(1:10)$z_score,
{expect_equal(suppressWarnings(akgfmaps:::backtransform_normal(scores = akgfmaps:::normal_transform(1:10)$z_score,
z_score = akgfmaps:::normal_transform(1:10),
make_plot = FALSE)), 1:10)})

Expand Down

0 comments on commit 31abe72

Please sign in to comment.