grambank / rgrambank

R package to access and analyse Grambank's CLDF data
Apache License 2.0
3 stars 1 forks source link

as_grambank_wide fails tests #33

Closed HedvigS closed 9 months ago

HedvigS commented 10 months ago

as_grambank_wide/as.grambank.wide fails test in main branch.

==> Testing R file using 'testthat'

[ FAIL 3 | WARN 0 | SKIP 0 | PASS 0 ]

── Error (test_as_grambank_wide.R:3:5): as.grambank.wide ───────────────────────
Error in `as.grambank.wide(gb$tables$ValueTable)`: could not find function "as.grambank.wide"

── Failure (test_as_grambank_wide.R:30:5): as.grambank.wide fails on incorrect formats ──
`as.grambank.wide("not a table")` threw an error with unexpected message.
Expected match: "'ValueTable' must be a dataframe."
Actual message: "could not find function \"as.grambank.wide\""
Backtrace:
    ▆
 1. └─testthat::expect_error(as.grambank.wide("not a table"), "'ValueTable' must be a dataframe.") at test_as_grambank_wide.R:30:4
 2.   └─testthat:::quasi_capture(...)
 3.     ├─testthat (local) .capture(...)
 4.     │ └─base::withCallingHandlers(...)
 5.     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))

── Failure (test_as_grambank_wide.R:31:5): as.grambank.wide fails on incorrect formats ──
`as.grambank.wide(data.frame())` threw an error with unexpected message.
Expected match: "Invalid table format"
Actual message: "could not find function \"as.grambank.wide\""
Backtrace:
    ▆
 1. └─testthat::expect_error(as.grambank.wide(data.frame()), "Invalid table format") at test_as_grambank_wide.R:31:4
 2.   └─testthat:::quasi_capture(...)
 3.     ├─testthat (local) .capture(...)
 4.     │ └─base::withCallingHandlers(...)
 5.     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
[ FAIL 3 | WARN 0 | SKIP 0 | PASS 0 ]

Test complete
HedvigS commented 10 months ago

Somehow, when I run the tests it's not accurately finding the functions. If I start with


library(rcldf)
library(tidyverse)
source("../../R/as_grambank_wide.R")

then the test passes.

OlenaShcherbakova commented 9 months ago

As far as I understand from the error message below, I run into problems loading the package due to this function.

Error: package or namespace load failed for 'rgrambank' in namespaceExport(ns, exports):
 undefined exports: as.grambank.wide
Error: loading failed
Execution halted
ERROR: loading failed
SimonGreenhill commented 9 months ago

Hi Olena, it should work now, please reinstall and try again