Skip to content

Commit

Permalink
do not always expect kilobytes
Browse files Browse the repository at this point in the history
  • Loading branch information
tdhock committed Apr 23, 2024
1 parent fe312cb commit 7781ff2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: atime
Type: Package
Title: Asymptotic Timing
Version: 2024.4.17
Version: 2024.4.23
Authors@R: c(
person("Toby", "Hocking",
email="[email protected]",
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Changes in version 2024.4.23

- Fix test-CRAN.R: kilobytes is not available on some systems.

Changes in version 2024.4.17

- New, simpler method for defining additional units to analyze (other than kilobytes and seconds): if result is data frame with 1 row, numeric columns are used as additional units. Arguments unit.col.vec and more.units have been removed from references_best.
Expand Down
7 changes: 4 additions & 3 deletions tests/testthat/test-CRAN.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ test_that("more units defined in 1 row result", {
N=1:30)
ref.list <- atime::references_best(atime.list)
disp.units <- sort(unique(ref.list$measurements$unit))
expected.units <- c("int","kilobytes","match.len","num","seconds")
expect_identical(disp.units, expected.units)
expected.units <- c("int","match.len","num","seconds")
## TDH 23 Apr 2024: kilobytes is not available on some systems.
expect_true(all(expected.units %in% disp.units))
expect_error({
predict(ref.list, match.len=40)
}, "match.len=40 is outside range of data, please change to a value that intersects at least one of the empirical curves")
Expand All @@ -81,7 +82,7 @@ test_that("more units defined in 1 row result", {
expect_true(all(my.pred.length$prediction[["unit.value"]]==match.len))
expect_error({
predict(ref.list, foobar=0)
}, paste("foobar is not a valid unit; argument names of predict must be one of these valid units:", paste(expected.units, collapse=", ")))
}, "foobar is not a valid unit; argument names of predict must be one of these valid units:")
my.pred.both <- predict(
ref.list, match.len=match.len, seconds=ref.list$seconds.limit)
if(interactive())plot(my.pred.both)
Expand Down

0 comments on commit 7781ff2

Please sign in to comment.