Commit fe77bcad authored by Chris Holbrook's avatar Chris Holbrook

initilize testing with testhat; start with read_glatos_detections

parent 657e1320
......@@ -15,6 +15,7 @@ Imports:
raster,
rgdal,
sp, data.table
Suggests: testthat
License: GPL (2.0 or later)
LazyLoad: yes
RoxygenNote: 6.0.1
library(testthat)
library(glatos)
test_check("glatos")
context("Check read_glatos_detections")
# Expected result (example data)
data(walleye_detections)
# Actual result
#get path to example detection file
det_file <- system.file("extdata",
"walleye_detections.zip",package="glatos")
det_file <- unzip(det_file, "walleye_detections.csv")
det <- read_glatos_detections(det_file)
file.remove(det_file) #clean up
# Test using testthat library
test_that("read_glatos_detections gives expected result", {
# Check if expected and actual results are the same
expect_equal(det, walleye_detections)
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment