2023-08-24 14:32:12 -05:00
|
|
|
//@no-rustfix: overlapping suggestions
|
2021-12-06 05:33:31 -06:00
|
|
|
#![warn(clippy::octal_escapes)]
|
|
|
|
|
|
|
|
fn main() {
|
2024-06-27 11:56:04 -05:00
|
|
|
let _bad1 = "\033[0m"; //~ octal_escapes
|
|
|
|
let _bad2 = b"\033[0m"; //~ octal_escapes
|
|
|
|
let _bad3 = "\\\033[0m"; //~ octal_escapes
|
2021-12-06 05:33:31 -06:00
|
|
|
// maximum 3 digits (\012 is the escape)
|
2024-06-27 11:56:04 -05:00
|
|
|
let _bad4 = "\01234567"; //~ octal_escapes
|
|
|
|
let _bad5 = "\0\03"; //~ octal_escapes
|
2021-12-06 05:33:31 -06:00
|
|
|
let _bad6 = "Text-\055\077-MoreText";
|
2024-06-27 11:56:04 -05:00
|
|
|
//~^ octal_escapes
|
|
|
|
//~| octal_escapes
|
2021-12-06 05:33:31 -06:00
|
|
|
let _bad7 = "EvenMoreText-\01\02-ShortEscapes";
|
2024-06-27 11:56:04 -05:00
|
|
|
//~^ octal_escapes
|
|
|
|
//~| octal_escapes
|
|
|
|
let _bad8 = "锈\01锈"; //~ octal_escapes
|
|
|
|
let _bad9 = "锈\011锈"; //~ octal_escapes
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
let _good1 = "\\033[0m";
|
|
|
|
let _good2 = "\0\\0";
|
|
|
|
let _good3 = "\0\0";
|
|
|
|
let _good4 = "X\0\0X";
|
|
|
|
let _good5 = "锈\0锈";
|
2023-04-23 06:03:09 -05:00
|
|
|
let _good6 = "\0\\01";
|
2021-12-06 05:33:31 -06:00
|
|
|
}
|