Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Description: Contains a number of common astronomy utility functions for cosmolo
License: LGPL-3
LazyData: TRUE
Depends: R (>= 3.00), RANN, NISTunits, pracma
Suggests: plotrix, igraph
Suggests: plotrix, igraph, testthat (>= 3.0.0)
LinkingTo: Rcpp
NeedsCompilation: yes
Config/testthat/edition: 3
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(celestial)

test_check("celestial")
11 changes: 11 additions & 0 deletions tests/testthat/test-coordinate-matching.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
test_that("single-coordinate matching chooses the nearest in-radius source", {
matches <- coordmatchsing(
RAref = 0, Decref = 0,
coordcompare = rbind(c(1, 0), c(0, 0)),
rad = 2, radunit = "deg"
)

expect_equal(matches$ID, c(2, 1))
expect_equal(unname(matches$bestmatch["compareID"]), 2)
expect_equal(unname(matches$bestmatch["sep"]), 0, tolerance = 1e-10)
})
Loading