alef 0.21.1

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{#- Setup fixture helper functions for R e2e tests #}

# Resolve fixture paths against the repo's `test_documents/` directory.
# testthat sources setup-*.R with the working directory at tests/,
# so test_documents lives three directories up: tests/ -> e2e/r/ -> e2e/ -> repo root.
# Each `test_that()` block has its working directory reset back to tests/, so
# fixture lookups must be performed via this helper rather than relying on `setwd`.
.alef_test_documents <- normalizePath("../../../test_documents", mustWork = FALSE)
.resolve_fixture <- function(path) {
  if (dir.exists(.alef_test_documents)) {
    file.path(.alef_test_documents, path)
  } else {
    path
  }
}