test_that("ubn works", {
  toy_ech_18 <- enrolled_school(data = ech::toy_ech_2018)
  toy_ech_18 <- years_of_schooling(toy_ech_18)
  toy_ech_18a <- unsatisfied_basic_needs(toy_ech_18)
  expect_equal(ncol(toy_ech_18a), 595)
  toy_ech_2018 <- poverty(data = ech::toy_ech_2018)
  expect_equal(ncol(toy_ech_18), 587)
  toy_2012 <- toy_ech_18 %>% dplyr::mutate(anio = 2012)
  toy_12 <- unsatisfied_basic_needs(data = toy_2012)
  toy_ech_18 <- poverty(data = ech::toy_ech_2018)
  expect_equal(sum(toy_ech_18$pobre06), dput(sum(toy_ech_18$poor)))
  toy_ech_18b <- integrated_poverty_measure(data = toy_ech_18a)
  expect_equal(ncol(toy_ech_18b), 596)
  toy_2012 <- toy_ech_18b %>% dplyr::mutate(anio = 2011)
  toy_12 <- unsatisfied_basic_needs(data = toy_2012)
  toy_ech_18 <- poverty(data = ech::toy_ech_2018)
  expect_equal(sum(toy_ech_18$pobre06), dput(sum(toy_ech_18$poor)))
  toy_ech_18b <- integrated_poverty_measure(data = toy_ech_18a)
  expect_equal(ncol(toy_ech_18b), 596)
})
