Skip to content

Can we make it easier to test UTF-8 handling? #1285

@lionel-

Description

@lionel-

Porting the UTF-8 tests of rlang to testthat3 was a bit tricky. The waldo_compare() function called by all testthat expectations calls reporter$local_user_output() which automatically skips the test when the locale is set to non-utf-8.

I found this workaround:

local_utf8_test <- function(frame = caller_env()) {
  reporter <- get_reporter()

  old <- reporter$unicode
  defer(reporter$unicode <- old, envir = frame)

  reporter$unicode <- FALSE
}

This doesn't seem like a proper long-term solution though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviortests 📘

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions