Skip to content

Commit

Permalink
Hopefully fixes erroring travis
Browse files Browse the repository at this point in the history
  • Loading branch information
hejtmy committed Aug 23, 2019
1 parent 27a7791 commit 305674d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ cache: packages

warnings_are_errors: false

r_packages: gifski

after_success:
- Rscript -e 'covr::codecov()'
7 changes: 0 additions & 7 deletions tests/testthat/test-preprocessing.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,3 @@ test_that("tests removal of unreal speeds", {
expect_equal(obj_speed, obj_speed_2)
})

test_that("testing search onset", {

})

test_that("testing search stops", {

})
28 changes: 28 additions & 0 deletions tests/testthat/test-search-onset.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
context("Onset searching")
obj <- navr_object_preprocessed
obj <- remove_unreal_speeds(obj, type = "std", cutoff = 3, total_recalculate = T)
obj <- smooth_speed(obj, type = "median", points = 11)

test_that("testing search onset", {
expect_silent(ls <- search_onsets(obj, speed_threshold = 5, min_duration = 2))
expect_gt(length(ls$time_since_start), 0)
expect_silent(ls <- search_onsets(obj, speed_threshold = 5, min_duration = 2, still_duration = 2))
expect_gt(length(ls$time_since_start), 0)
expect_silent(ls2 <- search_onsets(obj, speed_threshold = 5, min_duration = 2, still_speed_threshold = 5, still_duration = 2))
expect_equal(ls, ls2)
expect_silent(ls <- search_onsets(obj, speed_threshold = 500, min_duration = 2, still_duration = 2))
expect_length(ls$time_since_start, 0)
expect_silent(ls <- search_onsets(obj, speed_threshold = 1, min_duration = 200))
expect_length(ls$time_since_start, 0)
expect_silent(ls <- search_onsets(obj, speed_threshold = 1, min_duration = 1, still_duration = 200))
expect_length(ls$time_since_start, 0)
})

test_that("testing search stops", {
expect_silent(ls <- search_stops(obj, speed_threshold = 5, min_duration = 2))
expect_gt(length(ls$time_since_start), 0)
expect_silent(ls <- search_stops(obj, speed_threshold = 0, min_duration = 0))
expect_length(ls$time_since_start, 0)
expect_silent(ls <- search_stops(obj, speed_threshold = 1, min_duration = 1000))
expect_length(ls$time_since_start, 0)
})

0 comments on commit 305674d

Please sign in to comment.