Skip to content

Commit

Permalink
also test not signed
Browse files Browse the repository at this point in the history
  • Loading branch information
robitalec committed Nov 26, 2024
1 parent c23f786 commit 3f30aa1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/testthat/test-diff-rad.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pt_01 <- as_units(0.1, 'rad')
pt_02 <- as_units(0.2, 'rad')
pi_rad <- as_units(pi, 'rad')


# Adapted from: https://gist.github.com/bradphelan/7fe21ad8ebfcb43696b8
expect_equal(diff_rad(pt_01, pt_02, TRUE), pt_01)
expect_equal(diff_rad(pt_01, pt_02 + 2 * pi_rad, TRUE), pt_01)
expect_equal(diff_rad(pt_01, pt_02 - 2 * pi_rad, TRUE), pt_01)
Expand All @@ -18,3 +18,15 @@ expect_equal(diff_rad(pt_02 + 2 * pi_rad, pt_01, TRUE), -pt_01)
expect_equal(diff_rad(pt_02 - 2 * pi_rad, pt_01, TRUE), -pt_01)
expect_equal(diff_rad(pt_02, pt_01 + 2 * pi_rad, TRUE), -pt_01)
expect_equal(diff_rad(pt_02, pt_01 - 2 * pi_rad, TRUE), -pt_01)

expect_equal(diff_rad(pt_01, pt_02, FALSE), pt_01)
expect_equal(diff_rad(pt_01, pt_02 + 2 * pi_rad, FALSE), pt_01)
expect_equal(diff_rad(pt_01, pt_02 - 2 * pi_rad, FALSE), pt_01)
expect_equal(diff_rad(pt_01 + 2 * pi_rad, pt_02, FALSE), pt_01)
expect_equal(diff_rad(pt_01 - 2 * pi_rad, pt_02, FALSE), pt_01)
expect_equal(diff_rad(pt_02, pt_01, FALSE), pt_01)
expect_equal(diff_rad(pt_02 + 2 * pi_rad, pt_01, FALSE), pt_01)
expect_equal(diff_rad(pt_02 - 2 * pi_rad, pt_01, FALSE), pt_01)
expect_equal(diff_rad(pt_02, pt_01 + 2 * pi_rad, FALSE), pt_01)
expect_equal(diff_rad(pt_02, pt_01 - 2 * pi_rad, FALSE), pt_01)

0 comments on commit 3f30aa1

Please sign in to comment.