Skip to content

Commit 06e3703

Browse files
committed
Adds proxy test
1 parent f89fb2d commit 06e3703

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/testthat/test-twdtw_calls.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,16 @@ test_that("multiple functions return the same value", {
7474
}
7575
})
7676

77-
# Check output types
77+
# Test output types
7878
twdtw_call(output = 'distance')
7979

8080
twdtw_call(output = 'matches')
8181

8282
twdtw_call(output = 'internals')
83+
84+
# Test proxy call
85+
test_that("twdtw_call returns the same result as proxy::dist with given parameters", {
86+
expected <- proxy::dist(x = ts_x, y = ts_y, method = "twdtw", cycle_length = 'year', time_scale = 'day', time_weight = c(steepness = 0.1, midpoint = 50))
87+
actual <- twdtw_call(output = 'distance')
88+
expect_equal(actual[1], expected[1])
89+
})

0 commit comments

Comments
 (0)