File: test-getDividends.R

package info (click to toggle)
r-cran-quantmod 0.4.28-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 984 kB
  • sloc: makefile: 2
file content (12 lines) | stat: -rw-r--r-- 404 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
library(quantmod)

test.web.endpoints <- Sys.getenv("QUANTMOD_TEST_WEB_ENDPOINTS")

# split-adjusted by default
#if (nzchar(test.web.endpoints)) {
if (FALSE) {
  cf.div.adj <- as.numeric(getDividends("CF")["2015"])
  expect_true(all.equal(cf.div.adj, rep(0.3, 4)))
  cf.div.raw <- as.numeric(getDividends("CF", split.adjust = FALSE)["2015"])
  expect_true(all.equal(cf.div.raw, c(1.5, 1.5, 0.3, 0.3)))
}