Skip to content

Commit

Permalink
Agrega tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eliocamp committed Nov 29, 2020
1 parent 7729ad4 commit d4f0e95
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions R/parglo.maxlik.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# email='[email protected]'),
# person(c('Sergio','M.'), 'Vicente-Serrano', role='aut',
# email='[email protected]'))
# nocov start
parglo.maxlik <- function(x,ini) {
# generalized logistic log-likelihood function
glo.loglik <- function(theta,x){
Expand All @@ -31,3 +32,4 @@ parglo.maxlik <- function(x,ini) {
source='parglo.loglik',value=o$value,count=o$count,
conv=o$convergence,msg=o$message))
}
# nocov end
3 changes: 2 additions & 1 deletion R/spi-core.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# email='[email protected]'),
# person(c('Sergio','M.'), 'Vicente-Serrano', role='aut',
# email='[email protected]'))
# nocov start
spi_core <- function(data, scale, kernel=list(type='rectangular',shift=0),
distribution='log-Logistic', fit='ub-pwm', na.rm=FALSE,
ref.start=NULL, ref.end=NULL, x=FALSE, params=NULL, ...) {
Expand Down Expand Up @@ -171,7 +172,7 @@ spi_core <- function(data, scale, kernel=list(type='rectangular',shift=0),
return(z)
}


# nocov end
spi_params <- function(pp, ...) {
spi_core(stats::ts(pp, frequency = 1), ...)$coefficients
}
Expand Down
Empty file added tests/testthat/escala_surfer
Empty file.
Empty file added tests/testthat/kable
Empty file.
3 changes: 3 additions & 0 deletions tests/testthat/test-kable-inta.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test_that("multiplication works", {
expect_known_output(kable_inta(mtcars), "kable")
})
5 changes: 5 additions & 0 deletions tests/testthat/test-leer_surfer.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test_that("multiplication works", {
escala <- system.file("extdata", "escala_pp_mensual.lvl", package = "agromet")

expect_known_output(leer_surfer(escala), "escala_surfer")
})

0 comments on commit d4f0e95

Please sign in to comment.