Skip to content

Commit

Permalink
Add a simple test for #18
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Nov 9, 2020
1 parent 84b364b commit b302019
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
library(testthat)
library(slopes)

test_check("slopes")
6 changes: 6 additions & 0 deletions tests/testthat/test-slopes.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
test_that("slope_* functions work", {
x = c(0, 2, 3, 4, 5, 9)
e = c(1, 2, 2, 4, 3, 1) / 10
expect_equal(slope_vector(x, e), c(0.05, 0, 0.2, -0.1, -0.05))
# expect_equal(slope_distance(x, e), c(0.05, 0, 0.2, -0.1, -0.05))
})

0 comments on commit b302019

Please sign in to comment.