Skip to content

Commit

Permalink
make sure to skip greta related tests on CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
njtierney committed Dec 11, 2024
1 parent aa8da91 commit 757795d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
22 changes: 12 additions & 10 deletions tests/testthat/test-evaluate-smooths.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
n <- 30
x <- runif(n, 0, 10)
f <- function(x) {
sin(x * 2) + 1.6 * (x < 3) - 1.4 * (x > 7)
}
y <- f(x) + rnorm(n, 0, 0.3)
x_plot <- seq(0, 10, length.out = 200)
test_that("evaluate_smooths errors appropriately", {
skip_if_not(check_tf_version())
n <- 30
x <- runif(n, 0, 10)
f <- function(x) {
sin(x * 2) + 1.6 * (x < 3) - 1.4 * (x > 7)
}
y <- f(x) + rnorm(n, 0, 0.3)
x_plot <- seq(0, 10, length.out = 200)

z <- smooths(~ s(x), data = data.frame(x = x))
z <- smooths(~ s(x), data = data.frame(x = x))

distribution(y) <- normal(z, 0.3)

distribution(y) <- normal(z, 0.3)

test_that("evaluate_smooths errors appropriately", {
expect_snapshot(
error = TRUE,
evaluate_smooths("thing")
Expand Down
27 changes: 14 additions & 13 deletions tests/testthat/test-stop-when-dummy-in-data.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
test_df <- data.frame(
dummy = 1:5,
thing = LETTERS[1:5]
)
test_that("stop_when_dummy_in_data errors appropriately", {
skip_if_not(check_tf_version())

n <- 30
x <- runif(n, 0, 10)
f <- function(x) {
sin(x * 2) + 1.6 * (x < 3) - 1.4 * (x > 7)
}
y <- f(x) + rnorm(n, 0, 0.3)
x_plot <- seq(0, 10, length.out = 200)
test_df <- data.frame(
dummy = 1:5,
thing = LETTERS[1:5]
)

z <- smooths(~ s(x), data = data.frame(x = x))
n <- 30
x <- runif(n, 0, 10)
f <- function(x) {
sin(x * 2) + 1.6 * (x < 3) - 1.4 * (x > 7)
}
y <- f(x) + rnorm(n, 0, 0.3)
x_plot <- seq(0, 10, length.out = 200)

z <- smooths(~ s(x), data = data.frame(x = x))

test_that("stop_when_dummy_in_data errors appropriately", {
expect_snapshot(
error = TRUE,
stop_when_dummy_in_data(test_df)
Expand Down

0 comments on commit 757795d

Please sign in to comment.