identical(`substr_ctl<-`(txt0, 2, 2, value = "#"), `substr<-`(txt0, 
    2, 2, "#"))

identical(`substr_ctl<-`(txt0, 0, 0, value = "#"), `substr<-`(txt0, 
    0, 0, "#"))

identical(`substr_ctl<-`(txt0, 2, 1, value = "#"), `substr<-`(txt0, 
    2, 1, "#"))

identical(`substr_ctl<-`(txt0, 2, 3, value = "#"), `substr<-`(txt0, 
    2, 3, "#"))

identical(`substr_ctl<-`(txt0, 1, 5, value = "#"), `substr<-`(txt0, 
    1, 5, "#"))

identical(`substr_ctl<-`(txt0, 0, 5, value = "#"), `substr<-`(txt0, 
    0, 5, "#"))

## Bug in R means we can't use identical

identical(`substr_ctl<-`(txt0, 2, 3, value = rep1), `substr<-`(txt0, 
    2, 3, rep1))

identical(`substr_ctl<-`(txt0, 2, 3, value = rep2), `substr<-`(txt0, 
    2, 3, rep2))

identical(`substr_ctl<-`(txt1, 2, 3, value = "_"), `substr<-`(txt1, 
    2, 3, "_"))

identical(`substr_ctl<-`(txt1, 2, 3, value = rep1), `substr<-`(txt1, 
    2, 3, rep1))

identical(`substr_ctl<-`(txt1, 2, 3, value = rep2), `substr<-`(txt1, 
    2, 3, rep2))

identical(`substr_ctl<-`(txt2, 2, 3, value = "_"), `substr<-`(txt2, 
    2, 3, "_"))

identical(`substr_ctl<-`(txt2, 2, 3, value = rep1), `substr<-`(txt2, 
    2, 3, rep1))

identical(`substr_ctl<-`(txt2, 2, 3, value = rep2), `substr<-`(txt2, 
    2, 3, rep2))

identical(`substr_ctl<-`(txt0, 2, 3, value = NA_character_), 
    `substr<-`(txt0, 2, 3, NA_character_))

identical(`substr_ctl<-`(txt.na, 1, 2, value = "AB"), `substr<-`(txt.na, 
    1, 2, "AB"))

`substr_ctl<-`(txt2, 2, 2, terminate = FALSE, value = "#")

`substr_ctl<-`(txt2, 2, 3, terminate = FALSE, value = "#\033[32m?-")

`substr_ctl<-`(txt2, 2, 3, terminate = FALSE, value = "#\033[0m?-")

`substr_ctl<-`(txt4, 2, 2, carry = TRUE, value = "#")

## Lengths + Carry; note sequences in middle of `value` boundary are treated
## differently than on the ends.

`substr_ctl<-`(txt4, 2, 3, carry = TRUE, value = "#\033[0m?-")

## Weirdness here because the 39 in `value` causes re-issue of 45.  This is
## correct; a consequence of the mess of termintate=FALSE in replace mode.

`substr_ctl<-`(txt4, 2, 3, carry = TRUE, value = rep4)