Expected `result2` to match regexp "^~/Documents/projects/my-app$".
Actual text:
x | ~/Documents\projects\my-app

test_that("configure_author updates settings file", {
test_that("configure_data adds data source to settings", {
test_that("configure_data handles simple paths", {
test_that("configure_connection adds SQLite connection", {
test_that("configure_connection adds PostgreSQL connection", {
test_that("configure_packages adds package dependency", {
if (is.list(pkg) && pkg$name == "dplyr") {
expect_true(pkg_found, "dplyr not found in packages list")
test_that("configure_packages adds GitHub package with version", {
if (is.list(pkg) && grepl("tidyverse/dplyr", pkg$name)) {
expect_true(pkg_found, "tidyverse/dplyr@main not found in packages list")
test_that("configure_packages updates existing package", {
if (is.list(pkg) && grepl("ggplot2", pkg$name)) {
test_that("configure_directories sets directory path", {
test_that("configure_directories creates new directory entry", {
# Test skipped: configure functions are internal and may find settings files
# in parent directories when running in test environments. The error behavior
# is tested implicitly through other tests.
# Tests for .path_to_tilde() helper function
test_that(".path_to_tilde handles NULL and empty paths", {
test_that(".path_to_tilde handles paths already with tilde", {
# Already tilde notation returns unchanged
test_that(".path_to_tilde converts home directory paths to tilde", {
# Get actual home directory for reliable testing
# Path under home directory should convert to tilde
test_path2 <- file.path(home, "Documents", "projects", "my-app")
# Home directory itself returns just tilde
test_that(".path_to_tilde leaves non-home paths unchanged", {
# Paths outside home directory should return unchanged
test_that(".path_to_tilde handles paths with trailing slashes", {
test_path <- paste0(file.path(home, "code"), "/")

"configure_data adds data source to settings"
"configure_packages adds GitHub package with version"
"tidyverse/dplyr@main not found in packages list"
"configure_directories creates new directory entry"
".path_to_tilde handles NULL and empty paths"
".path_to_tilde handles paths already with tilde"
".path_to_tilde converts home directory paths to tilde"
".path_to_tilde leaves non-home paths unchanged"
".path_to_tilde handles paths with trailing slashes"