timings/91494b769959c85bd6fed521dc439dd3adde5aee/grattan/tests/testthat/test_gni.R

context("GNI")

test_that("GNI returns known results", {
  expect_equal(gni_qtr("1989-12-02", roll = "nearest"), 97145 * 1e6)
  expect_equal(gni_fy("1989-90"), 391176000000)
})

test_that("Error handling", {
  expect_warning(gni_fy("2016-17"))
})

context("GDP")

test_that("GDP returns known results", {
  expect_equal(gdp_qtr("1989-12-02", roll = "nearest"), 100576000000)
  expect_equal(gdp_fy("1989-90"), 404889000000)
})

test_that("Error handling", {
  expect_warning(gdp_fy("2016-17"))
})
HughParsonage/grattan documentation built on April 1, 2024, 4:10 a.m.