strtrim2_ctl("\033[42m\thello world\033[m foobar", 12, tabs.as.spaces = TRUE)

strtrim_sgr("\033[42m\the\allo world\033[m foobar", 12, warn = FALSE)

strtrim2_sgr("\033[42m\the\allo world\033[m foobar", 12, tabs.as.spaces = TRUE, 
    warn = FALSE, tab.stops = 2)

identical(strtrim_ctl(c("AB", NA_character_, "CD"), 1), strtrim(c("AB", 
    NA_character_, "CD"), 1))

strtrim_ctl(c("AB", NA_character_, "CD"), 1, carry = TRUE)

hello2.0 <- "\033[42m\thello world\033[m foobar"

Argument `width` must be a positive scalar numeric representable as an integer.

Error in strtrim2_ctl(x = x, width = width, warn = warn, ctl = ctl, normalize = normalize,  : 
  Argument `width` must be a positive scalar numeric representable as an integer.

strtrim_ctl(hello2.0, width = 10, warn = NULL)

Error in strtrim2_ctl(x = x, width = width, warn = warn, ctl = ctl, normalize = normalize,  : 
  Argument `warn` must be TRUE or FALSE.

strtrim_ctl(hello2.0, width = 10, ctl = 0)

Error in strtrim2_ctl(x = x, width = width, warn = warn, ctl = ctl, normalize = normalize,  : 
  Argument `ctl` must be character.

strtrim_ctl(hello2.0, width = 10, ctl = "bananas")

Argument `ctl` may contain only values in `c("all", "nl", "c0", "sgr", "csi", "esc", "url", "osc")`

Error in strtrim2_ctl(x = x, width = width, warn = warn, ctl = ctl, normalize = normalize,  : 
  Argument `ctl` may contain only values in `c("all", "nl", "c0", "sgr", "csi", "esc", "url", "osc")`

Error in strtrim2_ctl(hello2.0, width = "35") : 
  Argument `width` must be a positive scalar numeric representable as an integer.

Error in strtrim2_ctl(hello2.0, width = NA_integer_) : 
  Argument `width` must be a positive scalar numeric representable as an integer.

strtrim2_ctl(hello2.0, width = 10, warn = NULL)

Error in strtrim2_ctl(hello2.0, width = 10, warn = NULL) : 
  Argument `warn` must be TRUE or FALSE.

strtrim2_ctl(hello2.0, width = 10, tabs.as.spaces = NA)

Argument `tabs.as.spaces` must be TRUE or FALSE.

Error in strtrim2_ctl(hello2.0, width = 10, tabs.as.spaces = NA) : 
  Argument `tabs.as.spaces` must be TRUE or FALSE.