# Empty, because carry is presumed to exist open previously.

substr_ctl("\033[39m", 2, 3, carry = "\033[33m", terminate = FALSE)

substr_ctl("\033[39m", 2, 3, carry = "\033[33m", terminate = FALSE, 
    normalize = TRUE)

substr_ctl("", 0, 1, carry = "\033[33m", terminate = FALSE)

substr_ctl("\033[39m", 0, 1, carry = "\033[33m", terminate = FALSE)

# Should close because we do request one character

substr_ctl("\033[39m", 0, 1, carry = "\033[33m", terminate = FALSE, 
    normalize = TRUE)

substr_ctl("", 0, 0, carry = "\033[33m", terminate = FALSE)

substr_ctl("\033[39m", 0, 0, carry = "\033[33m", terminate = FALSE)

# No close because we read nothing at all

substr_ctl(character(), 2, 4, carry = "\033[33m")

substr_ctl(environment(), 2, 4, carry = "\033[33m")

cannot coerce type 'environment' to vector of type 'character'

Error in as.character(args[["x"]]) : 
  cannot coerce type 'environment' to vector of type 'character'

Error in substr2_ctl(x = x, start = start, stop = stop, warn = warn, term.cap = term.cap,  : 
  Argument `carry` must be scalar.

substr_ctl(str.0, 2, 4, carry = NA_character_)

Error in substr2_ctl(x = x, start = start, stop = stop, warn = warn, term.cap = term.cap,  : 
  Argument `carry` may not be NA.

substr_ctl(str.0, 2, 4, carry = character())

Argument `carry` must be logical or character.

Error in substr2_ctl(x = x, start = start, stop = stop, warn = warn, term.cap = term.cap,  : 
  Argument `carry` must be logical or character.

Error in normalize_state(str.2, carry = NA_character_) : 
  Argument `carry` may not be NA.

Error in normalize_state(str.2, carry = character()) : 
  Argument `carry` must be scalar.

Error in normalize_state(str.2, carry = 1) : 
  Argument `carry` must be logical or character.

Error in normalize_state(str.2, carry = Inf) : 
  Argument `carry` must be logical or character.

strwrap_ctl(wrp.0, 20, carry = NA_character_)

Error in strwrap2_ctl(x = x, width = width, indent = indent, exdent = exdent,  : 
  Argument `carry` may not be NA.

strwrap_sgr(wrp.0, 20, carry = character())