# default term cap should recognize bright and 256, but not true color.

hello.bright <- "\033[42mhello \033[103mworld wowza\033[49m"

strwrap_ctl(hello.bright, 13, term.cap = character())

strwrap_ctl(hello.255, 13, term.cap = character())

strwrap_ctl(hello.tru, 13, term.cap = "truecolor")

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

Error in strwrap2_ctl("a", NA_real_) : 
  Argument `width` must be a positive scalar numeric representable as integer.

Error in strwrap2_ctl("a", NA_integer_) : 
  Argument `width` must be a positive scalar numeric representable as integer.

strwrap2_ctl("a", -1, wrap.always = TRUE)

Width must be at least 2 in `wrap.always` mode.

Error in strwrap2_ctl("a", -1, wrap.always = TRUE) : 
  Width must be at least 2 in `wrap.always` mode.

strwrap2_ctl("a", 0, wrap.always = TRUE)

Error in strwrap2_ctl("a", 0, wrap.always = TRUE) : 
  Width must be at least 2 in `wrap.always` mode.

strwrap2_ctl("a", 1, wrap.always = TRUE)

Error in strwrap2_ctl("a", 1, wrap.always = TRUE) : 
  Width must be at least 2 in `wrap.always` mode.

tryCatch(strwrap_ctl("hello world", 6, prefix = "\033p"), warning = conditionMessage)

Argument `prefix` contains a non-CSI/OSC escape sequence at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

[1] "Argument `prefix` contains a non-CSI/OSC escape sequence at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings."

suppressWarnings(strwrap_ctl("hello world", 6, prefix = "\033p"))

tryCatch(strwrap2_ctl("hello world", 8, pad.end = "\t"), error = conditionMessage)

Argument `pad.end` must be an empty string or a single printable ASCII character.

[1] "Argument `pad.end` must be an empty string or a single printable ASCII character."

tryCatch(strwrap2_ctl("hello world", 8, pad.end = "  "), error = conditionMessage)

Argument `pad.end` must be at most one byte long.

[1] "Argument `pad.end` must be at most one byte long."

strwrap2_ctl("goodbye moon", 8, indent = 5, prefix = "> hello >")