library(bolder) options(bolder.width = 63) title <- bolder_format_title("data cleaning", "title") title_lines <- strsplit(title, "\n", fixed = TRUE)[[1]] stopifnot( length(title_lines) == 5, all(nchar(title_lines, type = "chars") == 63), grepl("DATA CLEANING", title_lines[[3]], fixed = TRUE) ) subtitle <- bolder_format_title("data cleaning", "subtitle") subtitle_lines <- strsplit(subtitle, "\n", fixed = TRUE)[[1]] stopifnot( length(subtitle_lines) == 3, all(nchar(subtitle_lines, type = "chars") == 63), grepl("DATA CLEANING", subtitle_lines[[2]], fixed = TRUE) ) simple <- bolder_format_title("data cleaning", "simple") stopifnot( nchar(simple, type = "chars") == 63, startsWith(simple, "# DATA CLEANING ") )