Expected `result` to equal "myvar".
Differences:
`names(actual)` is a character vector ('.*\'(.*)\' not found.*')
`names(expected)` is absent

test_that("catch_error extracts object names from error messages", {
extracted <- vapply(errors, catch_error, character(1), USE.NAMES = FALSE)
test_that("catch_error returns empty character for non-matching messages", {
result <- catch_error("This is not an error message")
test_that("catch_error handles empty input", {
test_that("catch_error works with English error message", {
result <- catch_error("Error: object 'myvar' not found\n")
test_that("catch_error works with French error message", {
result <- catch_error("Error in try(iri) : objet 'iri' introuvable\n")

"catch_error extracts object names from error messages"
"catch_error returns empty character for non-matching messages"
"catch_error works with English error message"
"catch_error works with French error message"
"Error in try(iri) : objet 'iri' introuvable\n"

catch_error works with English error message

Expected `result` to equal "iri".
Differences:
`names(actual)` is a character vector ('.*\'(.*)\' introuvable.*')
`names(expected)` is absent

catch_error works with French error message