Expected `as.character(out)` to equal `sandbox$config_dir`.
Differences:
actual vs expected
- "D:/temp/2026_02_22_13_40_16_22806/RtmpOEqzI4/filef54429541139/R/rpgconn"
+ "D:\\temp\\2026_02_22_13_40_16_22806\\RtmpOEqzI4\\filef54429541139/R/rpgconn"

test_that("init_yamls creates files in an isolated user directory", {
test_that("edit helpers return existing paths in non-interactive mode", {
test_that("dbc errors when RPG_CONN_STRING is not set", {
test_that("dbc parses URI connection strings", {
test_that("dbc parses postgres:// and IPv6 URI forms", {
test_that("keyword/value parsing supports semicolon, whitespace, and equals in values", {
c(RPG_CONN_STRING = "host='my host' user=alice dbname='my db' port=5432 options='-c search_path=schema1,schema2'"),
test_that("invalid connection string formats fail fast", {
withr::local_envvar(c(RPG_CONN_STRING = "foo"), .local_envir = environment())
withr::local_envvar(c(RPG_CONN_STRING = "mysql://user@host/db"), .local_envir = environment())
expect_error(dbc(), "must start with 'postgres://' or 'postgresql://'")
withr::local_envvar(c(RPG_CONN_STRING = "postgresql://user@host"), .local_envir = environment())
withr::local_envvar(c(RPG_CONN_STRING = "postgresql://host/?sslmode=require"), .local_envir = environment())
expect_error(dbc(), "Database name appears to be missing")
withr::local_envvar(c(RPG_CONN_STRING = "postgresql://user@:5432/db"), .local_envir = environment())
expect_error(dbc(), "Host portion after '@' is empty")
withr::local_envvar(c(RPG_CONN_STRING = "postgresql://user@host:abc/db"), .local_envir = environment())
expect_error(dbc(), "Port in connection string is not a valid integer")
withr::local_envvar(c(RPG_CONN_STRING = "postgresql://user@host:70000/db"), .local_envir = environment())
expect_error(dbc(), "must be between 1 and 65535")
test_that("invalid env var output redacts password values", {
expect_false(any(grepl("supersecret", messages, fixed = TRUE)))
test_that("cfg mode uses custom cfg_path and opt_path", {
temp_cfg <- withr::local_tempfile(fileext = ".yml")
temp_opt <- withr::local_tempfile(fileext = ".yml")
list(options = list(connect_timeout = 30, application_name = "rpgconn-tests")),
test_that("legacy path argument remains supported and deprecated", {
args <- dbc(cfg = "legacy", db = "warehouse", args_only = TRUE, path = temp_cfg),
other_cfg <- withr::local_tempfile(fileext = ".yml")
"Specify only one of `path` or `cfg_path`"
test_that("cfg mode validates missing config and missing db", {
dbc(cfg = "missing", db = "x", args_only = TRUE, cfg_path = temp_cfg),
dbc(cfg = "dev", args_only = TRUE, cfg_path = temp_cfg),